Yes with the following two caveats:
1) As Robert Taft noted, trying people for ex post facto laws, is victor's justice and isn't good for rule of law. Hitler was a terrible terrible person, so I'm sure there is some Nazi or Weimar era law you can try him for.
2) The theatrical punishments are too much show and have the potential for making post WW2 Germany think of the West like post WW1 Germany did. Just hang him somewhere with few witnesses.
There are clearly background principles of international customary law that prohibit mass genocide, slavery, bombing of civilian targets, unprovoked invasions, etc, that existed in 1939. It's a little bit ridiculous to think that international war crimes can only be punished if they are criminalized by the country which committed them.