Most democratic country can accept constitutional amendment, if it is directly vote by a clear majority of its population. However, what if the majority of your nation have voted for the end of your democratic republic and the formation of THE FIRST GALACTIC EMPIRE...

aka dictatorship like how Hitler did to the Weimar Republic , can that be legally acceptable? Is there any political mechanism in modern democracy to prevent them from happening?