The Nazis could at times be weirdly meticulous about following the forms of law; the Reichstag Fire Decree carefully cited the relevant article of the Weimar Constitution which permitted emergency decrees suspending civil liberties; after the Night of Long Knives Hitler promulgated the aforementioned (and ex post facto) “law” which nearly literally said “All those things we did yesterday were legal”. Any attempt to hold the surviving Nazi leadership criminally liable for, say, the viciously antisemitic Nuremberg Laws (which deprived German Jews of their citizenship and civil rights) would arguably have been ex post facto, an infringement on German sovereignty, and a blatantly hypocritical thing for the United States to have (hypothetically) done or participated in, given the contemporaneous existence of Jim Crow in much of the U.S.A.
But it’s worth pointing out that there was never any kind of formal law legalizing the mass murders of the Holocaust (the Shoah, and the Porajmos or the Romani people). I am not saying that Hitler didn’t give the orders–I’m quite certain that he did–but if surviving Nazis were prosecuted for mass murder for things they did at Auschwitz and Treblinka, there was no Law of 20 January 1942 or Führer Decree of 12 December 1941 they could point to, whereby being a Jew was made a capital crime. They were “just following orders”–what orders? Again, the point is not to let Hitler himself off the hook, but rather to point out that Hitler fundamentally acted like a “gangster” (as Churchill liked to point out). He got his caporegimes together and, however euphemistic or however blunt he may have been in private, he made no public decrees and left no written records concerning his orders to commit genocide.
Then, there is the fact that the worst of Nazi crimes took place on the soil of other countries–especially Poland–and against citizens of many other states which Nazi Germany had invaded. Germany was a signatory of the Kellogg-Briand Pact, and I am not aware of Germany taking any steps (before the Nazis came to power or afterwards) to formally renounce or withdraw from that treaty. By the terms of the Kellogg-Briand Pact, Germany had agreed to give up “recourse to war” as “an instrument of national policy” in its foreign relations, and to seek only peaceful solutions for all international disputes. (Although the Pact was not as clear as Article 51 of the subsequent United Nations Charter in allowing for defensive war, the language in the Kellogg-Briand Pact’s preface did state that “any signatory Power which shall hereafter seek to promote its national interests by resort to war should be denied the benefits furnished by this Treaty”.)
So, under the rule of Hitler and the Nazis, Germany–illegally and in violation of its treaty obligations–waged offensive and imperialistic warfare, conquering numerous other countries. Having illegally invaded, occupied, and in parts annexed various other sovereign states, Nazi Germany then carried out a policy of deliberate–but formally completely unacknowledged–mass murder. The Nazis clearly understood that what they were doing would be seen as criminal by the world–they consistently sought to conceal the mass murders (there were certainly no triumphant headlines in the Völkischer Beobachter, “Führer Decrees Law Making It Capital Crime to Be a Jew!”); the Jews were supposedly simply being “evacuated to the East”, or (allegedly humanely) housed in a “model concentration camp”. When the Nazis began losing the war they had started, and enemy armies began overrunning the territories where their mass murders were mainly being committed–again, territories the conquest of which was illegal by the terms of Germany’s solemn treaty obligations–the Nazis began a deliberate program of destroying the evidence of their murders.
What the Nazis did were absolutely crimes, and the Nazis clearly knew it themselves.