Ian McKellen actually comments on this on his official website (see http://www.mckellen.com/epost/x001128.htm)
Q: In his first scene Magneto seems to have a Nazi-like philosophy. "We are the future, Charles, not them." That line could be put in Hitler's mouth just as easily when he spoke of the Jews.
A: Hitler's power used constitutional power to oppress minorities. Magneto is a political subversive fighting for freedom. The rhetoric might be similar but their beliefs are not.
Doop's recent comments: