No, but check with your DM for spells
The entrance to the portable hole is not a normal, physical opening. It is a gate or portal to an extradimensional space, that works to transport things from where you are into or out of the hole.
While the game does not define how distance works accross portals in general because portals are so varied, the opening to a portable hole seems to be very similar to a physical opening where distance works normally:
- you can pass things in or out,
- you can climb in or out using your normal movement,
- air is passing in or out.
If you can drop an object in, you can also shoot an arrow in. Both are objects.
For a spell like fireball, the hole has no language against counting distance normally or about blocking effects. Compared this to rope trick, that says "Attacks and spells can't cross through the entrance into or out of the extradimensional space". You would expect similar language, if it was not possible.
So, it should work and it seems likely that effects could extend into and out of the hole, and you can cast spells into and out of it, using normal, linear distance.
Allowing this for spells however enables shenanigans with glyph of warding put onto the walls of the hole, that can kill pretty much any opponent. So the DM may decide that for balance reasons this won't work. Before you rely on it, check with them, as they have the right and a valid reason to rule otherwise.