It's basic storytelling, and accessible to readers, especially since the Nazis are some of history's most terrifying and notorious villains.
Some of these stories are more realistic than others, but all play upon alternate histories.
'…they reinforce the suspicion that we may not be finished with the Nazis, or that they may not be finished with us.' The manga The Legend of Koizumi has the prime minister of Japan battling Hitler on the Moon in a game of mahjong. The 2014 video game Wolfenstein: The New Order borrows heavily from Dick's work in terms of narrative and features an entire level where you infiltrate a moon base. Dick, the Nazis, having won WWII, have colonized Mars and Venus. In The Man in the High Castle by Philip K.
One of the earliest instances of this trope is in Rocket Ship Galileo, a 1947 young adult novel by Robert Heinlein, which features three teenagers who travel to the moon and discover a secret Nazi base. People love putting Nazis in space, especially when it comes to science fiction.