Hitler lost the direct presidential election, but Hindenburg (his competitor in that election) didn't appoint him as chancellor for no reason; Hitler's NSDAP was the largest party in the Reichstag, and was therefore a natural choice for forming a government. That's roughly the same level of democratic legitimacy as that of any other German chancellor since.
The Nazis also lied and cheated and murdered, but it wasn't necessary for their rise to power; until they went about abolishing democratic institutions altogether, they could have worked entirely with above-the-board means.