It seems highly unlikely that a show like that could be set in the Iraq or Afghanistan wars without significant backlashe from veterans.
Just as a clarifying point, the 60's and 70's were anywhere from 15 to 34 years after WWII ended - so your premise that Iraq and Afghanistan veterans wouldn't stand for comedies about Iraq and Afghanistan is at a minimum a decade premature, for the same context. Your question's premise is framed in the years 2025-2045.
As far as I can tell, there indeed was some controversy when Hogan's Heroes first aired though I don't know if it would qualify as a backlash. The question asked by many journalists and some viewers was not so much if it was ok to depict the Germans as silly but rather if setting a TV show in a camp (a POW camp in the show but some apparently mixed it up with a Concentration Camp. /u/kugelfang52 could go more into depth concerning the American public's perception about camps in Nazi Germany in that regard).
Bob Crane, who played Hogan, had missed WWII but had been enlisted. He was also one of the most staunch defenders of this show. His biography mentions that after the show first aired and press articles brought up the issue if it was ok to have a show set in a German camp, he toured several Veteran's associations to talk to WWII vets. By all accounts, most the response was overwhelmingly positive. In 1968 he said in an interview: "The ex-POWs in Albuquerque, NM, have an association. They had a convention and invited me. A lot of POWs are hooked on Hogan's Heroes. They're our biggest rooters--along with New York Jewish delicatessen owners!""
The other important defender of the show that convinced a lot of people that Hogan's Heroes didn't have some sort of malicious or bad intent was Robert Clary, who portrayed Loius LeBeau on the show. Clary was a Holocaust survivor. Born a French Jew, he was rounded up and deported by the Germans to Buchenwald where he was liberated while also losing several family members in Auschwitz. Also, on the shows cast was Werner Klemperer (Klink), who was the son of Viktor Klemperer, a linguist and Jewish survivor of Nazi Germany Otto Klemperer, a famous composer who fled Germany in 1935. Klemperer signed up to the show under the condition that Klink must always lose. Both Clary and Klemperer defended the shows premise with the arguments that it was intended to show the Nazis' as idiots while at the same time have the horror of their deeds lurking around the corner.
This was not a new way to approach the subject. During WWII both Charlie Chaplin and Ernst Lubtisch had used this method of making ridicule of the Nazis while implying their brutality to great effect in films like the Great Dictator and To Be or Not to Be. It was an acceptable way of dealing with the subject because of the – rightful at some level – social perception that there was something entirely ridiculous about the Nazis all the while keeping their horrible deeds in mind.
The show itself and the response to it needs to be seen within the social climate of the time, namely, the escalating Vietnam War. As Lisa M. Mundley discusses in her book American Militarism and Anti-Militarism in Popular Media, 1945-1970, 2012, Hogan's Heroes is a show that belongs into the category of the "war as adventure" genre. Hogan's tells the story of a communal effort to defeat an enemy that is bumbling at times but nonetheless dangerous (the Gestapo in the show is a moniker for the dangers of the Germans). It even went so far as to try introduce a Soviet POW but that proved not possible in the Cold War climate and the character disappeared again.
However, what is important about the show and its telling of WWII as an adventure where sharp wit and intelligence can beat a bumbling but at times nonetheless dangerous enemy is that it hit a nerve with its portrayal of a group of allied people coming together to beat an evil enemy. An enemy that nonetheless can be understood and ridiculed. At the time, this was difficult to do with the North Vietnamese since they had a greater degree of "otherness" and because the war in Vietnam, unlike WWII, did not inspire the same feeling of fighting a "good war" in the public. While broad swaths would have seen it as justified maybe, there still was controversy around the war itself to a measure that was not associated with WWII.
Hogan's was only one product of that particular wave of entertainment. Movies like Where Eagles Dare or Kelly's Heroes, both with Clint Eastwood as well as to a certain extend MASH (though that one differs slightly) all played into this social and medial trend of wanting to assure an American public that it was possible to fight a war that was good, that could be understood and where the enemy had been dangerous but also stupid to a certain extent.
This was how, even despite initial criticism of the premise of the show (not so much the Germans' portrayal) the show became such a hit and ran for six season.
Edit: Minor corrections.
As a follow up: was MASH controversial amount Korean War veterans?
Good afternoon everyone!
Apparently there haven't been many moderators online today, because I genuinely thought this was an /r/AskReddit thread from the responses it was getting until I noticed all the reports. Then I realised it was my job to ruin everyone's fun clean the place up. I've since had to remove a staggering number of comments for breaking /r/AskHistorians strict Subreddit rules regarding quality, depth and expertise.
/r/AskHistorians is not your average Subreddit. We're not here for funny jokes, Wikipedia links, or random trivia. We exist to provide comprehensive, expert responses to questions which are asked here.
We've all seen Dad's Army, or Hogan's Heroes or F Troop or the likes, but to be clear: Your personal interpretation of the show does not qualify you to write a two line piece of "here's what I think" about what WWII veterans thought four decades ago. If you want to talk about that, go to /r/AskReddit.
If people continue to comment in a rule-breaking fashion, the /r/AskHistorians mod team will be ready!
Edit: I can't spell F Troop, and it's also the Old West, not WWII, but shoosh. :P