The Man in the High Castle is set in an alternate timeline where the Germans did win the war by developing nukes first. They then bombed DC, leading to the US surrendering. Germany then took over Europe, Africa and most of the Americas while Japan conquered Eastern Asia, Oceana, and the American West Coast.
But in reality, it was not a close race. The Manhattan Project was invested in heavily due largely from fears that Germany would develop nuclear weapons first, but their Uranproject had largely been abandoned by the time the US started their equivalent. German physicists first discovered nuclear fission, and their government began seeking how to develop a bomb shortly after. However, Germany essentially gave it up as unachievable in the near term as they never managed to achieve a chain reaction or even enrich Uranium. Secret recordings show their scientists did not initially believe the news about Hiroshima, thinking it impossible with then-modern technology.
They did come fairly close to developing the first nuclear reactor however, as scientists were still interested in civilian if not military applications. It's interesting that today Germany houses US nuclear weapons for defense as part of NATO but has a population firmly opposed to nuclear power.