They usually got power through violent means such as revolutions or coups or similar things. They would tell people that there is a common enemy from another country, or from within the country in the case of Germany, and explain that it was their fault for all bad things in the country. When they would get high enough of a support, they would organize violent riots and protests and coups and similar things to take power.