If a character does not roll for spells, either because they come stock with a spell, get to choose directly or has the Loremaster (I know ALL the spells) trick, then you can have duplicates. The only time you can't have duplicates is if the wizards involved are getting them by virtue of rolling randomly. Of course, random generation is by far the most common way, but a few armies have the ability to just take all the spells or the ones they want.
Of course the other option is having the spell cast on you over and over again during the course of the game. That sucks too.