80 years of Holocaust scholarship have been a pitched battle over various questions. Few Holocaust scholars except the denialists would say it wasn't "legal" in Nazi Germany given the Nuremburg Laws and subsequent directives of the Final Solution.
Here is a helpful list of historians and celebrities who support that denialist position (see Kanye West):
Who's Who of Holocaust Denial | ADL
The other main argument was between the "Functionalists" and the "Intentionalists"
Functionalism–intentionalism debate - Wikipedia
Put into a bumper sticker:
Functionalists: To some degree the Nazis hated Jews but the actual Final Solution was more part of various organs of power slipping into the decision to commit genocide because it seemed to fit with the overall war or just they felt they were interpreting Hitler and other leading Nazi's views.
Intentionalists: Hitler may have never signed any directive but everything that happened was because he wanted it to happen.
The degree to which these battles were fought and were tinged with political hues of left/right etc. And to which some of the best scholars (e.g., Raul Hilberg) were tainted because they were somehow less tough on the Nazis for being "Functionalists" is just weird in hindsight. Hilberg wrote a MASSIVE accounting of the process of the Holocaust which is an amazing document. Just a massive tesseract of historical work. He counted each train, each arrival, each order he could find. He knew all about the size and shape of the Holocaust.
At the end of the day...my heart is in both academic camps and despairs of the conflict. Clearly Hitler was sociopathic toward the Jews and none of this would have happened if he had not wanted it to happen.