It was a not-unheard of occurrence during World War II. Since American heavy bombers flew in tight formation to maximize bombing accuracy and fend off fighter attacks, there was always the risk of a bomber drifting and being hit by bombs dropped from above. This B-17 lost its left horizontal stabilizer, while this B-17 lost its entire tail section. This popular footage is often said to be a result of a bomb striking the wing root of the B-24 from above, but further analysis as well as some aviation archaeology determined that the cause of loss was antiaircraft fire.
The Luftwaffe developed several outlandish anti-bomber tactics until methods became more refined in the later part of 1943, including trailing bombs on long cables, or attempting to drop bombs or mines on enemy formations from above.
Source:
Caldwell, Donald. JG 26 Luftwaffe Fighter Wing War Diary Volume Two: 1943-45. Mechanicsburg: Stackpole Books, 2012.
Follow up: in dog fights, when the trailing plane shot at and potentially exploded the lead plane, did debris ever cause damage to the trailing plane? It always seems to me that parts of the first plane would contact the props of the back plane and make that one go down.
Yes, there are several. u/the_howling_cow has mentioned several instances of B-17s being hit by friendly bombs.
There are several instances of RAF aircraft being hit by bombs. This link hs a report of a 514 sqdn Lancaster being lost to a bonb from a higher flying Halifax, whilst this photo of an early model Halifax shows bomb damage from a bomb strike. This is a relatively famous photo of the damage to a Lancaster after the rear turret was hit by a bomb.
One of the problems that the RAF had, was that they flew in 'streams' rather than formations, which whilst practical at night, resulted in increased losses due to collisions between aircraft and aircraft being hit by bombs from aircraft flying at higher altitudes.
Along with the previous replies mentioning the cases in WWII, there was a situation in 1984 where an TA-4 Skyhawk was closely following an F/A-18 on a test run, where the F/A-18 was dropping a dummy bomb made of concrete. The TA-4 was in a bad position and the bomb was caught in some sort of turbulence between the planes, and ended up being pulled upward into the wing of the A-4.
Here's some slow-motion video of it. There are full speed versions available, but this is the only one I could find that didn't have that "Amazing Videos!!" tv show type narration over it.
Follow up: how common was friendly fire from the gunners shooting other B-17s?