As @Nullo says, WW2 was an extension of WW1. The nature of the Versailles Treaty forced that. As General Foch commented at the time “This is not a peace treaty, it’s an armistice for twenty years” and he was right almost to the month. Germany was treated like an utterly defeated power when, on the battlefield, the war ended in virtual stalemate. The right wing in Germany drummed away at this in the 20s, arguing that Germany had been “stabbed in the back” by the left, which overthrew the monarchy and incited the sailors of the High Seas Fleet to mutiny rather than attack the Allied blockade. It was this sea blockade and the resulting food shortages that forced the German government to sign the lopsided Versailles pact.
This takes us to the late 1920s. The National Socialists (Nazis) were only one of about a dozen parties on the right, all chanting the same slogans. An assassination of Hitler at this point would have meant another right party would have taken the lead, with about the same results, only with a von Papen or Ribbentrop at the helm.
By the late 30s, the Nazis had taken credit for an economic turnaround based largely on rearmament and public works projects. An assassination at this point would have left the Nazis in power, but with someone like Hermann Goering in power, another ideologue amateur strategist. Remember, the German General Staff were genuinely nonpolitical, cared only about strategy and logistics and were indoctrinated to serve whoever was in charge.
By the time the war had expanded into the East, June 1941, the Allies had adopted a policy of unconditional surrender. Nothing short of that would satisfy Stalin or Churchill; Germany was committed to a war to the finish, regardless of who was in charge. After the fall of France in 1940, Germany had attempted to negotiate peace with the U.K. to no avail (the attempt was largely symbolic, neither Hitler nor Churchill really wanted a negotiated peace). Any assassination after 1941 would have found a new German leader in a position of either surrender unconditionally or fight to the end. Only an assassination prior to June 1941 might have averted disaster for Germany.
Had German expansionism stopped at some point (say, after the annexation of Czechoslovakia), a major war would have been postponed but not averted. But this would have meant a 180 degree turn in German foreign policy, unlikely even with Hitler out of the picture. Stalin was as eager to seize Polish territory as Hitler was, as well as domination of the Baltic states, destabilization of Romania, Bulgaria, etc. A delayed war would have been at least as costly, only with different alliances and battlefields; say an Anglo-German-Italian-Finnish army fighting in the Urals, France and the Low Countries neutral and the U.S. fighting a separate war in the Pacific. Now we’re into Harry Turtledove territory.