Well, lets look at this in terms of what is available magic-wise to default DnD characters, as useful in attacking a castle during a siege:
Darkness, Protection from Arrows, Endure/Resist Energy and Elements (from burning oil), Hold Portal (might have a use), Grease, Obscuring Mist...
Wait a minute. Pretty much every spell is useful. I'll eventually get to Disinegrate and then Game's Over. So, in answer to your post, YES, given balanced magic, and one side anticipated the attack from the other, then appropriate counter measures could be taken. A mix of clerics and wizards on both sides could raze and defend a castle with equality. It would be much a like a regular DnD skirmish on a huge scale.
Interesting enough, i was just reading Clash of Kings yesterday during a certain siege. On the dawn of the first day, before the battle is even joined, the leading commander is killed by (in DnD terms) a relatively low level spell. As magic is virtually unknown in the Seven Kingdoms, no one had any defense or idea of what or how it happened.
In a low magic campaign, magic used wisely (and viciously) can turn even enormous odds to your advantage.