I hear it repeated every so often and it always makes me wonder if there was a distinction between 'what people knew was happening was legal' and 'what was happening was actually justified by national law'.
Edit: Grammar
Strictly speaking, no. Much of Hitler's power to govern came from the Enabling Act of 1933 which amended the Wiemar Constitution to allow Hitler to legislate and govern by decree without approval from the Reichstag. The Enabling Act had limits, however. One proviso was that the office of President would not be changed. But after Hindenburg's death in 1934, Hitler abolished the position entirely. This act was illegal. But by this time no one could do a thing about it.
But of course, the point that MLK was making in that context stands regardless. It is not morally right to obey a law simply because it is the law.
See Richard J. Evans' "The Coming of the Third Reich" for more about how the Nazi's gained power, and especially chapter 5 for the passing of the Enabling Act.
How could the Night of the Long Knives be legal? They got away with it, sure, but they had documents burned and covered up as much as they could. Hitler eventually copped to ordering the executions of the "traitors" but just because he and his co-conspirators weren't prosecuted for them doesn't mean that the murders were legal.