I was surprised to learn in this awesome video about the USS New Jersey that the funnel on an Iowa-class battleship is not a straight line, there's a bit of a zig-zag in it. The idea was that, unlike with a straight funnel, a bomb could not fall directly into the engineering spaces bypassing the armor. This doesn't seem like a likely occurrence to me, which makes me wonder if it ever actually happened?
Has it ever happened? In WW2, yes, but more by luck than intention considering (1) the size of a funnel's hole in relation to the ship's total deck surface area and (2) the lack of sophisticated guidance systems. Also, because of the angle, shells fired by another ship would more likely just blow the funnel off than actually go down it. However, aerial bombardment did result in a few cases of bombs going down funnels, including two Royal Navy destroyers at Dunkirk.
Examples (but not the USS Arizona)
Among the few examples was the Royal Navy destroyer HMS Grenade at Dunkirk:
While later embarking troops alongside at the East Mole, Dunkirk she was bombed and set on fire in Dunkirk harbour on May 29th, 1940, when taking part in the evacuation of the British Army.
At 16.00 hours she was hit again, this time seriously, one of which went straight down a funnel and she caught fire and swung out of control into the fairway.
Image source: hmscavalier.org.uk
This is also mentioned in this article which cites a 19-year-old sickbay attendant called Bob Bloom witnessing it:
At about 6pm, Grenade was hit by a bomb dropped by a plane flying with the third wave of bombers, and Bloom has described how he was affected: “I was coming down a ladder leading from the sickbay to the mess deck when a bomb went down the ship’s forward funnel and exploded. I was thrown up in the air and hit the deckhead.
Also at Dunkirk, on June 1st, the destroyer HMS Keith came under heavy fire:
The Keith avoided direct hits by taking violent evasive action. Near misses jammed her rudder. A second dive-bombing assault put a bomb down her aft funnel. Its explosion wrecked the destroyer's boiler room and caused severe flooding. Then a third attack delivered a bomb under the destroyer's bridge that caused her to capsize.
On the same day during the Dunkirk evacuation, a bomb went down the funnel of the transport ship Scotia:
...on the morning of the 1st of June 1940, H.M. Transport ship Scotia was targeted by Junkers 87 (Stuka) dive bombers. Of at least four bombs that hit the Scotia, one went down the funnel before exploding, and soon the ship was listing astern.
The above was witnessed by SS Scotia's Captain William Hughes. Two weeks after Dunkirk (but also not a warship), survivors of the RMS Lancastria reported that had a bomb go down its funnel, but this was disputed by the ship's engineering officer.
There was also an incident in February 1941 in the Mediterranean concerning a merchant ship:
...one German plane sent a bomb down the Clan Macaulay's funnel but it went out through the ship's hull without exploding.
The Clan Macaulay survived the attack, and the war. Finally, the Poelau Bras, a passenger ship pressed into military service (as a troop transport ship), was also apparently sunk by a bomb down the funnel during an attack by Japanese dive bombers on March 6, 1942 off the coast of Java.
this was contradicted when the ship's superstructure was salvaged in 1942 and the funnel cap was found to be intact.
In 1934, the First Sea Lord told the Prime Minister that all Admiralty studies showed the battleship to be "impervious" to air attack. War gaming rules in the United States Navy reflected this conviction.
and, in the US Navy,
Admiral A.J. Hepburn said that he attached little importance to aerial attack, since the probability of hits was small. He did feel that if a battleship were struck by a bomb the damage might be considerable. Admiral Ernest J. King believed that with optimum conditions, bombers might expect to get 5 percent hits.
Of greater concern / relevance in funnel design was (and is) the issue of pollution of the ship. Also,
their shape and location are dictated by considerations of naval tactics, location of weapons & sensors on topside and increasingly, the IRSS (Infra Red Signature Suppression) system.
Source: P.R. Kulkarni et al., 'The Smoke Nuisance Problem On Ships - A Review', in 'The International Journal of Maritime Engineering 147(a2)' (January 2005).
Nonetheless, by 1936, the British naval architect Stanley Goodall noted that the development of increasingly powerful bombs warranted greater protection for ship decks, including funnels. Thus,
A particular objective was to study the effect of bombs exploding within the funnel and the effectiveness of armour gratings. It was found that bombs exploding in the funnel opened up the boiler casing and the uptakes which would have caused a loss of pressure in the stokehold and a momentary flashback, possibly starting a fire. The support to the armour gratings needed to be stronger and it was recommended that gratings be fitted both at upper and middle deck levels since a heavy-case bomb could penetrate a single grating.
Source: David K. Brown, 'Nelson to Vanguard: Warship Design and Development, 1923–1945' (2000)
The statement was mostly tongue in cheek I think, given the Star Wars references.
Whether something ever happened before the ship was designed is mostly irrelevant in designs however. What's relevant is whether it could happen. Given the size of the funnel and the ever increasing accuracy of dive bombers, it may well have been thought that yes, it's feasible that this could happen and therefore a good idea to design for it.
However, the real reason for the design is probably different, namely that the smokestacks needed to curve in order to properly line up with the boilers.