Yes they did. Following WWI a group created the The Hague Rules of Air Warfare which states, among other things:
Article XX
When an aircraft has been disabled, the occupants when endeavoring to escape by means of parachute must not be attacked in the course of their descent.
While The Hague Rules of Air Warfare were never put into active law, many pilots chose to follow similar codes of conduct, as they regarded themselves as "knights of the air", and shooting a bailing pilot, who had no way to fight back, and would likely be taken as prisoners of war anyway, was seen as unnecessarily barbaric and cruel.
During WWII there were never any explicit international laws forbidding the act of shooting down a bailing pilot, but both during and after the war many nations heavily discouraged the tactic.
This was not universal however, as many suggested that pilots shot down over friendly territory would return to active fighting service, but this was met with great resistance from pilots, and military leaders, including Winston Churchill and Hermann Göring, who regarded it as murder, and akin to shooting a drowning sailor. Despite this, many incidents of shooting down a bailing pilot occurred throughout the war, on both sides and on all fronts, but they were relatively uncommon, at least among American, British, German and Italian pilots. I can't find much information about how Russian and German pilots regarded each other.
The Japanese on the other hand held none of these opinions, as they regarded surrender to be dishonorable, and a bailing pilot was seen as having surrendered. The Japanese frequently shot down bailing enemy pilots, and in some cases even strafed survivors who had landed in the water, or killed them rather than take them as prisoner.
In fact, the Akutan Zero, which famously gave the USA a great deal of information on the plane and its weaknesses, was shot down after it had fired upon the crew of a Catalina PBY who had bailed out in the water.
Despite this, the Geneva Convention originally made no mention of bailing pilots, and protections for them would not be signed into international law until 1977, which modified the Geneva Convention to give pilots explicit protection.
From a Western European perspective, I think that I can provide a partial answer to you.
From reading lots of accounts from air crew who served over Europe, there is nothing to suggest that attacking air crew who had successfully bailed out of aircraft was ever really a thing. The accounts of aces such as Douglas Bader and Johnny Johnson (among others) all give the impression that they tried not to think of the men in the aircraft they were attacking. In fact, some of the more successful Luftwaffe night-fighter pilots cliamed to attack the wings of their targets to try to give the crews a chance of escaping their aircraft.
I have heard uncorroborated reports that there were isolated incidents of German pilots attacking prachuting aircrews in their parachute, only to be immediately shot down and killed if they bailed out, but it seems to have been very isolated, if it did indeed happen.
The Thin Red Line by John Nichol -reference to night fighter pilots
Spitfire by Alfred Price
Regarding the Eastern Front, this rule seems to have been mostly followed in dogfights between Finnish and Soviet aircraft. The code of conduct of not attacking parachuting opponents is mentioned in several memoirs of Finnish fighter pilots, and even though there have been claims of Soviet pilots machine gunning parachuting Finnish pilots, I could not quickly find any documentary evidence. (It should be remembered that claims that the opponent is violating the rules of war have been common throughout the ages.)
However, all sides violated these rules from time to time. Most pilots probably refrained from shooting parachuting opponents most of the time, but I believe there are enough reliable accounts to say that this "honor code" was not universally nor reliably followed.