The nazi germany was a national-socialist country and as i know socialism is a stage before the communism , so how can the nazis be anti-communist ?
A few quotes from Hitler in that regard:
When Strasser argues for “revolutionary socialism,” Hitler dismisses the idea, arguing that workers are too simple to ever understand socialism:
“Your socialism is Marxism pure and simple. You see, the great mass of workers only wants bread and circuses. Ideas are not accessible to them and we cannot hope to win them over. We attach ourselves to the fringe, the race of lords, which did not grow through a miserabilist doctrine and knows by the virtue of its own character that it is called to rule, and rule without weakness over the masses of beings.”
[...] Hitler argues, a “workers council” taking charge of a company would only get in the way.
“Our great heads of industry are not concerned with the accumulation of wealth and the good life, rather they are concerned with responsibility and power. They have acquired this right by natural selection: they are members of the higher race. But you would surround them with a council of incompetents, who have no notion of anything. No economic leader can accept that.”
[...] Hitler isn’t making the case for socialism, much to Strasser’s dismay. He is making the case for fascism
“Fascism offers us a model that we can absolutely replicate! As it is in the case of Fascism, the entrepreneurs and the workers of our National Socialist state sit side by side, equal in rights, the state strongly intervenes in the case of conflict to impose its decision and end economic disputes that put the life of the nation in danger.”
And you could say Hitler's use of "socialism" was based on his appropriation and redefinition of the term, a fact he admitted:
In that same interview with Viereck, Hitler added:
“Socialism is the science of dealing with the common wealth. Communism is not Socialism. Marxism is not Socialism. The Marxians have stolen the term and confused its meaning. I shall take Socialism away from the Socialists.
Socialism, unlike Marxism, does not repudiate private property. Unlike Marxism, it involves no negation of personality, and unlike Marxism, it is patriotic... We are not internationalists. Our socialism is national. We demand the fulfillment of the just claims of the productive classes by the state on the basis of race solidarity. To us state and race are one.”
National-Socialist isn't Marxism. They value the nation, but Marxism does not. Marxism advocates internationalism. In 1930s, most Communist parties pursue Marxism. And Communist Party is far-left, Nazi Party is far-right.
The term "National Socialism" arose out of attempts to create a nationalist redefinition of "socialism", as an alternative to both Marxist international socialism and free market capitalism. Nazism rejected the Marxist concepts of class conflict and universal equality, opposed cosmopolitan internationalism, and sought to convince all parts of the new German society to subordinate their personal interests to the "common good", accepting political interests as the main priority of economic organization, which tended to match the general outlook of collectivism or communitarianism rather than economic socialism.