AFAIK it technically wasn't even legal in Nazi Germany. Some German officer was actually investigating these crimes (abuse of prisoners in the camps) until the Nazis dealt with him (can't remember his name though).
Even then, there was no law that legalized the Holocaust afaik. The Nazis just did it with impunity, because who would stop them anyway?