There are countless instances of prisoners straight up being shot out of hand in WWII on both sides, though some instances were more common than others.
As mentioned in the European theatre Soviet POWs taken by Germany were probably treated the worst, POW ‘camps’ no more than barbed wire stockades where prisoners were simply left to starve, succumb to disease or the brutal whim of a guard. The first prisoners gassed at Auschwitz were Soviet POWs.
Stalin’s Order No. 270 rejected even the concept, Stalin commenting “There are no Soviet prisoners of war, only traitors.” This included his own son, who died in Sachsenhausen. The case of Mikhail Devyatayev demonstrates the attitude towards POWs back in the USSR, extraordinarily he escaped Nazi slavery by stealing an aircraft. When the NKVD got hold of him they imprisoned him for the remainder of the war, his papers marked him as a criminal for allowing himself to be captured in the first place. He was only cleared in 1957.
Hitler’s 1942 Commando Order mandated that any captured Allied commandos, even in uniform, should be executed without trial in a concentration camp.
Similar to flamethrower troops, I’ve read that snipers were loathed as ‘personalising’ the impersonal business of war and often executed out of hand.
SS men were often wont to massacre prisoners and were repaid in kind. In Normandy there was mutual loathing between Canadians and the 12th SS ‘Hitlerjugend’, following an SS massacre. Following the liberation of Dachau, American troops executed a number of SS guards. Speaking of the SS, their black uniforms caused lethal instances of mistaken identity for panzer crews, also clad in black.
Allied bomber crews were depicted as monsters, and there are multiple instances of downed RAF and USAF crews being beaten, shot or even lynched in enemy captivity.
Japanese treatment of POWs has already been mentioned, including keeping prisoners as meat on the hoof. The fate of any prisoner who found themselves on one of the notorious Hell ships is also a grim one. Kept in crowded, stinking holds with the additional fear that Allied subs could torpedo the unmarked ship.