Several Nazi leaders were executed for their role in the Third Reich's many crimes following the war. If it was justifiable to execute men like Ribbentrop and Sauckel, than it would certainly be justifiable to execute the man who was their boss. Hitler started the Second World War and had attempted to eradicate entire religious and ethnic groups. His plans for victory would have seen millions killed and enslaved. In the eyes of the Allied powers and most others, executing Hitler would not only be perfectly legally justifiable (others were executed for less) but completely morally justifiable.
Would everyone have accepted this moral justification? No. Morality, like beauty, is in the eyes of the beholder. There are still people today (Neo-Nazis, mainly) who think that Hitler was right in his actions, and they certainly wouldn't have seen his execution as morally justifiable.
Ultimately, however, whilst Neo-Nazism is still around, the Allies had managed to quite thoroughly destroy the actual Nazi Party and most sympathy towards it during and following the war. Had Hitler have died on the gallows in Nuremberg instead of in his bunker in Berlin, I don't think history would be much different. There would have been those who would have seen it as amoral, but they wouldn't have had the ability to do much about it. Speculating too much would take us into the territory of alternate history - ultimately, no one can tell you what the differences would have been.
Sorry, but your submission has been removed because we don't allow hypothetical questions. If possible, please feel free to rephrase the question so that it does not call for such speculation, and resubmit Otherwise, this sort of thing is better suited for /r/historicalwhatif.