my old boss once saw I had the wikipedia homepage open on my laptop which had the Karl Marx article as featured article of the day, and she proceeded to interrogate me about being a marxist and spending time reading marxism instead of working
spoiler
which I of course did, all day everyday, but ironically not on this one occasion
Socialism was popular amongst the public in the interwar period; hyperinflation, post-WW1 destruction etc were contributing factors.
The nazi party was originally the DAP (German Workers' Party; a socialist party), which Hitler was tasked with infiltrating when he was an officer in the army.
He was eventually discharged, but maintained his position in the party and saw it as a tool to achieve ulterior goals.
After he became party leader, he took them in a more nationalist direction but maintained the essence of socialism in the party, hence NSDAP (National-socialist German Workers' Party), else he might risk a calamitous exodus of the party membership leaving them a fringe element.
Certain key members like Röhm, leader of the Sturmabteilung, were socialists, though more like what you might call patsocs nowadays, until they too were ousted on the Night of the Long Knives.
There are historical photographs of Nazi rallies where supporters hung banners saying "Marxism must die for Germany to rise again"
TL;DR, it was originally a socialist party; Hitler co-opted it for his own means and gradually purged the left-wing elements and consolidated power until it was a fully fascist entity.
Required reading on the topic is chapter one of Michael Parenti's "Blackshirts and Reds"; it covers other aspects such as how capitalists flooded the nazis with resources to aid their rise to power.