Taking The Custodian's thought one step further...

It makes sense that Yellow Submarine is an allegory for World War II. It was still fresh in everybody's mind, even the children, who grew up on war stories. So that helps make the story of the Yellow Submarine more understandable, by placing it in the context of the war.

But more interesting is how the allegory plays out. It isn't brute force that wins the day, as happened in 1945, but music. It reflects the notion, very much in vogue in 1968, that music, not war, can save the world from dark forces. The Beatles, of course, were altogether happy to place themselves in that role.

It is also interesting to note that there is no role for a Soviet Union in Yellow Submarine. Of course, few in the 1960's West acknowledged the Soviets' central role in defeating Germany in the war.