I think the inspiration for the term "Grammar Nazi" was not directly the original Nasty Nazis, but rather the character on the Seinfeld TV program known as the Soup Nazi, who insisted that everybody follow his rules to the letter.
I just didn't understand the term in that context.
As with many catchwords, it can have different meanings to different persons or cultures.
As for the word "nazi", it is IMO just a extremely negative term used to disqualify others, just that.
E.g. translate "fkng bstrd" to other languages. It sounds childish at most, not a real invective