But that's a strawman. I'm not talking about the origin of Nazi racism, but about the concepts that rationalized that racism. Nazis were racist because they scapegoated foreigners to solve their social problems, and they did so because free societies are vulnerable to demagogues, and because prejudices are often rooted in instincts.
But once racism comes to the fore, the question is how the racist justifies it in cultural terms, and Nazis used language that's reminiscent of the Jewish purity code. That language doesn't come from genetics or from the theory of natural selection. Where do geneticists talk about "pure" or "impure" genes? There are mutations, but they're seen as good because they're crucial to a species' adaptation to new circumstances. Plus, of course, the sciences are supposed to be value-neutral, so science alone could hardly justify a normative concept of pure or master races.