Can a warrior cast a powerful spell?
Yes and no. To learn powerful spells, you have to invest your skill points into spells. Doing so will prevent you from learning a lot of the skills usually associated with a fighter type. Also, spells require a high amount of intelligence and wisdom, whereas fighters require strength and agility. It is recommended that you try to concentrate in one specific area, while learning a few spells (or skills) that could be useful to you.
Let me tell you the story of Merthon Badbreath. He once tried to learn everything all at once. Engaged in a perilous combat against an experienced warrior, he had a fireball in his left hand and a shortsword in his right one. Instead of throwing the fireball, he threw the shortsword. Result? The fireball exploded in his hand and he was no more of this plane. The shortsword has been suspended on top of his enemy's fireplace.