In Italy, fascism developed as a way to assert the Kingdom of Italy's former dominance and reclaim its former territories as heirs to the Roman Empire. Nationalism and fascism go together hand in hand, and the Italian people believed they must restore their Empire to its former glory and control the Mediterranean. Like many issues of WWII, fascism is linked to WWI. Italians believed they didn't reap the full benefits of the Treaty of Versailles and that they must assert themselves.
In Germany, again, we can look to the problems of WWI and see a direct correlation to the conditions that would allow fascism to develop. The Treaty of Versailles ending WWI crippled Germany economically and crushed the spirit of the German people. Hitler's rise was due, in large part, to his ability to bring hope to people and their willingness to follow his lead to bring Germany back to prominence. Fascism allowed Hitler to control the economy, curb the inflation, use nationalism to bring pride back to his people, and, like Italy, use its military power to reclaim historical lands and bring honor back to Germany.