Germany was clearly interested in developing nuclear power for military purposes. However, as stated, the project didn't get very far. The Allies went to a lot of trouble to disrupt a source of heavy water.
Before the war even ended, an American specialist team went into Germany to get German scientists and their records. See "Now it can be told" by Gen. Leslie Groves.
Japan was also working on a nuclear weapon, although their project was extremely limited in size and basically just lab research.
When nuclear fission was discovered and announced in January 1939, scientists worldwide knew of the potential for extremely powerful weapons and began to think about the issues involved.
We are fortunate that making a nuclear weapon is not easy at all. This is why 60 years later so few nations have them. Making the fuel is very difficult as well is detonation. Of course, one can't help but wonder what would've happened if the U.S. had the bomb a year later, say August 1944. The Allies still face high losses slogging through Europe to Germany at that point, and a great many losses in the Pacific against Japan. Thousands, perhaps millions of enemy civilians and soldiers would also die. The shock of a single bomb doing the work of a huge fleet of conventional bombers would've been the shock to end the war.