You could replace the orcs in lotr with the germans, and their leader as sauron. Does that make lotr racist? I don’t think so.
That said, I"m fairly sure you'd have to change a number of things to make "goblins/orcs" match up with real world Germans (such as the cannibalism) But it's been some years since I read LOTR.