Simply put, military humor, Love It or Hate It. This particular brand of funny centers on stereotypically dim-witted military personnel, asshole officers, and naive recruits.
Comes in two flavors: Wartime and Peacetime. Expect a wartime military farce to turn Darker and Edgier in the penultimate act when the "real war" comes calling for the characters.
As is 91 Stomperud, its licensed Norwegian equivalent. It began in 1937.
Flygsoldat 113 Bom (the Air Force) and Flottans gossar, Frisk och Rask (the Navy) aren't, however, but they had a good long publishing history. Basically, up until very recently Sweden had a conscript army for a very long time, so almost all adult Swedish males could relate to military humour. Beetle Bailey is also absurdly popular in Sweden for the same reason.
Beetle Bailey is a peacetime variant to comic extremes, centering on a military camp located on the US which has somehow managed to remain uninvolved in armed conflict despite numerous wars over the strip's lifetime (Possibly because the Army has figured out that the best way the soldiers in that camp can aid the war effort is to stay as far away from it as possible).
Bill Mauldin's Willie And Joe, published in during WWII, and later collected in Up Front and Back Home. He made fun of the top brass so well General Patton threatened to stop publication of Stars and Stripes, but Eisenhower came to Mauldin's defense due to the comics' morale-boosting effect.
Astérix: Roman soldiers are portrayed as a bunch of weak and incompetent losers.
The Carry On films visited this theme several times:
Carry On Sergeant is set among National Service recruits in the British Army, who comprise an assortment of buffoons, snobs, hypochondriacs, and ne'er-do-wells.
Carry On Jack is set in the Navy during the Napoleonic Era, with a chronically seasick captain, his scheming first mate, and an accident-prone midshipman.
Carry On Follow That Camel is set in the French Foreign Legion, with the usual clueless officers and naive NCOs and privates who couldn't find their way out of a sandpit, much less find their way through the desert.
Carry On Up the Khyber is set in the British Raj, and starts with the joke that the supposedly terrifying kilted soldiers of the local regiment (who include a motley group of cowards and clots) actually wear giant pairs of underwear beneath their kilts.note Until the final scene, anyway.
Carry On England is set in a gender-integrated military division on the Home Front in World War II, the members of which are far more interested in pursuing sexual escapades than in anything to do with the military, to the frustration of the incompetent CO and the buffoonish RSM.
Modern readers of M*A*S*H may be surprised to find that the original book was more about military farce than social commentary. Later books in the series do include a lot of social commentary, but it's conservative social commentary.
Captain Fatso was just one a series of little remembered but once popular navy farces written by Rear Admiral Daniel V. Gallery.
The Ship with the Flat Tire
The McAuslan series by George MacDonald Fraser consists of affectionate, semi-fictional Armed Farces stories. His Quartered Safe Out Here is a less farcical, less fictional (though still quite funny) memoir.
Hašek’s classic satire The Good Soldier Švejk is about the lunatic ineptitude of the Austro-Hungarian Army in WW1 seen through the eyes of the cunning soldier Švejk.
Evelyn Waugh's Sword of Honour trilogy is a story of a man who trains to be an elite commando in World War II... and spends almost the entire war dealing with pointless bureaucratic red tape and farcical incompetence. Only once in the entire war does he actually even see a German soldier with his own two eyes, and that is an indication that he has gotten hopelessly lost and accidentally gone too far toward enemy lines. This series was based on Waugh's own experience as a Royal Marine during the war, during which he participated in several military actions... all of which were incompetently-managed and utterly ineffective fiascoes.
A section specifically made for military humor has always been a tradition for Reader's Digest magazine.
Mary Gentle's Grunts! has military joking aplenty. From the hapless recruits under Gunnery Sergeant Ashnak early in the evolution of the Orc Marines to the equally hapless elf recruits and their orc trainer Sgt. Dakashnit later on. Dakashnit's advice for her recruits on what to do if their parachute fails, in particular.
Rally Round the Flag, Boys!, about the establishment of a Nike base in the New England town of Putnam's Landing.
Major Dad inevitably included some miliary farce (as you would expect from the title) though the true focus was on Domestic Comedy.
The first couple seasons of M*A*S*H included a lot of military farce before they decided to concentrate more on general social commentary. However, at least some military humor was inevitable, given the setting.
NCIS and its parent series JAG this trope only happens Stateside and not when on the frontlines.
Team Fortress 2 in general, really. As opposed to a typical realistic military First-Person Shooter, everything uses a cartoony style and the different playable classes are larger-than-life humorous personalities.
The first Battlefield: Bad Company, where three military screw-ups and their long-suffering sergeant go AWOL to hunt for mercenary gold.
Batty Battalion Follows this trope to the tee, It has stupid military personnel, asshole military personnel and naive military personnel who spend more time bitching about each other and the Covenant than actually fighting them.
The Simpsons Homer winds up joining the army and ends up in a squad of dimwits like him, they took part in an army exercise which involves using them as cannon fodder, they run off and hide in Springfield to which the army occupies the town to flush them out.
The Mask once joined the marines and somehow was put in charge of guarding a battleship, to which he traded to kid for baseball cards.