Yes, but not most of it
So what do you need to cast a spell? You need Line of Effect, and you need to fulfill any special requirements of the spell (having targets, or a maximum range, or components, or picking the version of the spell coming into effect, etc).
It's pretty easy to tell if you have line of effect. You have line of effect if you have line of sight and nothing's in the way. Most portal-y things work this way when 'open', so you're probably good. That means, barring any special properties of the portal (like banning magic across the threshold like rope trick) or special requirements of the spell, you're good. Unfortunately most spells have a particularly troublesome requirement: Range.
So, you're standing somewhere in a dark underground passage and there's this portal to Hell and you see a cactus a bit of a ways in and so you say to yourself "Boy, that looks to be about 120' feet away, I should have no problem fireballing that cactus from here", but you are wrong! See, while the cactus may look like its just a hop skip and a jump across the border, in actuality it is only the magic of the portal that allows you (and other stuff) to cross an immesurable gulf and enter the realm on the other side. How far is Hell from the Material Plane? It's not a distance, certainly not in any real quantity like 'feet' or even 'miles'. Your fireball can only target things within several hundred feet-- the catcus, close as it may seem, is immeasurably further away than that. Unless a portal specifically says it alters how magic ranges work, what matters is not how many feet of movement it would take to get somewhere but how close the origin point of a spell actually really is for real (take that, Special Relativity!). Unless you believe regular portals actually move the planes around and rip them apart the way, say, precipitate complete breach et al. do, there's no way the actual objective position of that hell-cactus is within a real number of feet of you.
Basically, this means that any spell with a finite numeric range is out (and 'Unlimited' was already out, of course). Spells with a range of 'touch', however, or a range of 'see text' with text that doesn't limit their range prohibitively can be cast across planar gateways, by default. Additionally, the effects of spells can certainly pass through a Gate-like portal, provided the portal has no statement preventing that and those effects don't need to remain within the spell's range (like the fire of a fireball unfortunately does). Indeed, Gate itself says:
You could position a gate in a hallway in order to absorb any attack or force coming at you by shunting it to another plane. Whether the denizens of that plane appreciate this tactic is, of course, another matter.
Magic that isn't spells is mostly in the clear, of course, with magic swords and golems and rivers and the like seeming not to have any trouble going through planar gateways.
Disclaimer: While this answer addresses the general case of portals in general, almost all actual portals and portal-like thingies in 3.x contain language preventing the use of spells across their border, directly or indirectly. It is only in the generic Gate-like portal system asked about that this default is relevant.