Hollywood made numerous "service comedies" about life in the Armed Services during and just before WWII, mostly set during training with little if any combat onscreen. I've have searched for yet not found anything similar made in Germany, Italy or Japan, but would be fascinated to see one if it exists, especially a German or Japanese one.
Under the Nazi regime, the film industry became a very controlled enterprise. From June 1933, all cast and crew in Germany had to be licensed by the state and all films approved at every stage of production. By 1937 the industry had effectively been nationalised with the giant UFA forming the core of the business.
While there were notable propaganda films such as Jud Süß (Veit Harlan, 1940), The Eternal Jew (Fritz Hippler, 1940) and Leni Riefenstahl's seminal masterpiece documentaries The Triumph of the Will (1935) and Olympia (1936), these were in the minority. They are the best known German films of the era, but when Goebbels set the Nazi film policy, he prioritised entertainment over Nazi politics. In contrast to the Soviet Union, film was to be used to maintain public morale rather than to indoctrinate the population. Indeed, Robert & Bertram (Hans Heinz Zerlett, 1939) was the only anti-semitic musical comedy ever produced under the Third Reich, the exception in what was otherwise a highly popular genre.
That's not to say that Nazi cinema in the 1930s was untouched by "light" or subtextual propagandising in every film, with situations and characters conforming to Nazi values such as a nuclear family, honesty and ingenuity. Particularly as the war progressed it became more fervent, with the disaster in Titanic (Herbert Selpin / Werner Klingler, 1943) being directly caused by English and American capitalist greed at the expense of the noble yet poor European victims.
But the goal of Goebbels was to provide an evening's escapist entertainment. As such, films about the military are relatively uncommon; when war is confronted (of course with Germanic or Aryan characters in the heroic roles) it is most often through the veil of time, such as the Napoleonic war or Seven Years' War. Or, for those in modern settings like Three Sergeants (Werner Hochbaum, 1939), the focus is on the characters' private lives rather than on war glories.
Military Comedies wouldn't fit in to the German cinema of the time, where comedies were mostly farces or comedies of errors. They were intended to draw attention away from military matters, so it would defeat the point to have characters in military situations.
Follow up question. Would it have been legal to do so in Germany?
This is not related to the film industry but the Wehrmacht did have other ways to utilize humor. The official Tiger and Panther tank manuals included funny/risqué situations. This was mixed with technical information.
"The illustrations in the Tigerfibel were done by Obergrenadier Gessinger and Unteroffizier Wagner. These included allegorical sketches, technical drawings, photographs and cartoons. The cartoons often involved an attractive blonde woman named Elvira who frequently found herself without any clothes or in a romantic setting with cartoon Tiger crewman. The Tigerfibel also contained many short, memorable verses and limericks referred to as “morals” or “mottos”. All of this was done to capture and hold the attention of the fledgling trainees."
Images in the link are NSFW