So allies won the world war-II. Hitler killed himself. Japan Surrendered. I read all that multiple times but how did Allies manage to crush the ideology of fascism in Germany? Because Hitler might be dead but fascism is an idea and how did Allies manage to replace that ideology with an ideology of accepting everyone as humans?
Well one big thing the Allies did was win the war in a very obvious way. Fascist claims about how only they could offer protection from the Communists and how a country united under one strong leader was thereby superior to divided and quarrelsome democracies looked pretty implausible.
Beyond that, arguably the main drivers of change were domestic. In the case of West Germany, James L. Payne argues that many American policies, particularly from 1945 to 1948, were deliberately aimed at punishing the Germans. Even the deliberate de-Nazification policy the Americans pursued was done in such a broad-brush way as to arouse resentment and was abandoned in 1951 by the American authorities. The Americans did undertake initiatives like changing school textbooks to non-fascist ones but that would hardly have affected the middle-aged and older adults who were setting up the post-war German democracy.
And remember that the Germans, Italians and Japanese had histories of democratic and liberal (or at least more liberal than the fascists favoured) to fall back on. Payne says of Germany:
The Christian Democratic Party—soon to become the ruling party in West Germany—was founded by a group of thirty-five German political leaders in Berlin two weeks before U.S. military forces even reached the city. On their own, they drew up a declaration of principles, rejecting Nazi ideas such as the primacy of the state and asserting the importance of individuals and families.
West Germany also had Ludwig Erhard. Erhard was part of the Soziale Marktwirtschaft, or “social free market" movement, with a history of opposition to Nazi policies. Erhard, as an economist with a record of anti-Nazisim, was appointed as the director of the bizonal Office of Economic Opportunity in 1947 and spent his time advising the Americans to make pro-market reforms, including currency reforms and removing price controls. There's a story about his interactions with General Clay, the military governor of the US zone:
In July 1948, after Erhard, on his own initiative, abolished rationing of food and ended all price controls, Clay confronted him:
Clay:“Herr Erhard, my advisers tell me what you have done is a terrible mistake. What do you say to that?”
Erhard:“Herr General, pay no attention to them! My advisers tell me the same thing.”
Ludwig Erhard went on to be appointed as West Germany's first minister of economic affairs, indicating some domestic support.
The US did get involved in writing constitutions, particularly in Japan, but there's reason to be skeptical of the importance of written constitutions. Plenty of countries with democratic constitutions have ignored inconvenient provisions or rewritten them into non-democratic forms, conversely the UK and New Zealand have never had written constitutions and keep on holding elections. In Japan, under the new Constitution, the Liberal Democratic Party held power continuously from 1955 to 1993, quite different to the changes of power seen in other democracies.
More generally, there's a long history of failures by Western countries and Western-funded agencies to bring about peace, democracy and prosperity in countries without a history of it. While some of these failures can arguably be attributed to less-than-pure motives on the part of the Westerners, such impure motives can also apply to the Allies' interventions in Germany, Japan and Italy post WWII.
This is not to say that it was inevitable for Germany, Italy and Japan to adopt democracy and what was, if not entirely liberalism, at least more liberal than fascism, the relevant politicians deserve some credit for not stuffing things up. In summary, the main thing the Allies likely did was defeat fascism militarily. With fascism discredited on that level, the return to democracy was arguably due to domestic reasons.
Sources
Easterly, William. 2006. The White Man’s Burden: Why the West’s Efforts to Aid the Rest Have Done So Much Ill and So Little Good. New York: Penguin
Payne, James L, Did the United States Create Democracy in Germany?, The Independent Review, Volume 11 Number 2 • Fall 2006
Payne, James L, 2006. Does Nation Building Work? The Prospects for Democracy in High-Violence Societies. The Independent Review 10, no. 4 (spring): 597–608.