I am a long way from being an apologist for protestantism. Still, I think it’s a stretch to attribute Nazism to Protestanism generally or to Luther specifically, except in one way only.
It needs to be remembered that Hitler was anti-Christian. He killed Protestants too. Yes, he established a Reichskierke, but it seems pretty plain that he would have stamped out Lutheranism as well as Catholicism if he could have done it. At some point he probably would have done it, but he needed both for cannon fodder.
Now, I don’t pretend to be a historian, but it’s true that Luther and his movement did encourage a radical sort of independence on the part of the North German princes. He was, in that sense, the apostle of their hearts’ preexisting desires for independence and autarky. That Protestantism encouraged a tight nationalism in opposition to the more polyglot and diffuse Holy Roman Empire is not seriously questioned.
But Frederick’s Prussia was perhaps the most “nationalistic” of all. It saw “Germany” as something wider than its own boundaries or even the boundaries of those who were linguistically German. As the later Bismarck maneuvered to unify the German states by “blood and iron” as he put it, he ultimately pressured and sometimes simply forced the Catholic states and some of the reluctant protestant states in to a “supernation” so powerful and so dominant on the continent that he created what was, for its time, a one-ethnicity “empire”; a very aggressive “superpower”. At the time, of course, Prussia was a resolutely Protestant state. Unlike the southern Germans, the warlike Junker class was very protestant and quite contemptuous of the southern German people. The Catholic southern Germans were not inclined to become part of the pan-German superstate, but didn’t have sufficient power to resist it…not even Bavaria. Had Bismarck been able to crush Catholicism in Germany for the sake of 'supernationhood", he would have. It was only because he had to deal with the resistant German parliament that he couldn’t. It wasn’t so much his devotion to Protestantism that motivated him as it was his belief in an utterly unified and disciplined state; Frederick’s Prussia writ large.
Hitler fell heir to all of that. Hitler was a liar and a trickster, but he had a good nose for those things Germans had an affinity for. Hitler, of course, played on the “pan German” idea, annexing Austria and the Sudentenland. And he played on the “supernationalism”, and in that he did gain the support of what was left of the Junker class. He was the monsterous doppelganger of something that had been going on in Germany for a long time. He did have more Protestant than Catholic support, but again, he would have turned Protestantism into something much more like paganism in time if he had the chance, and a lot of protestants would have died in the exercise.
Had Protestants and Catholics seen through the tricks and the lies early on, he would not have gained a power no one in Germany could defeat, despite his strong appeal to an excessive German nationalism; a nationalism that was more north German than south German, but which, by then, all shared to some degree.
So, to the extent that Luther and Lutheranism encouraged a nationalism that became aggressive, ethnocentric and destructive, I guess one could say there is a link. But it’s the kind of link in which the ultimate outcome would not likely have been perceived at the outset, and one in which there was a relationship but not an inevitable metamorphosis.
The irony of all of it is that Luther himself probably encouraged it as a way of protecting himself. The Empire was not friendly toward him. In doing so, though, he did open a pandora’s box, the ultimate effects of which he doubtfully foresaw.