Yes, it happened in the past, but measures were taken to prevent such accidents from happening again.
In the evening of December 8, 1963 a Pan Am Flight 214, a trice weekly Boeing 707 service from San Juan, PR to Philadelphia with a stopover in Baltimore was holding at 5000 feet over Elkton, Md. There was heavy rain and lightning in the area. At 8:58 the aircraft exploded. The pilots had just enough time to make a MAYDAY call. Seconds later a pilot of another plane in the same holding pattern radioed "Clipper 214 is going down in flames." NTSB determined that the most probable cause of the accident was a lightning strike that ignited the fuel vapors in reserve fuel tank.
On December 24, 1971 a LANSA Flight 508, a Lockheed 188 Electra turboprop, operating a domestic flight from Lima to Pucallpa, Peru was struck by lightning and broke up in the air as it flew through a thunderstorm.
Miraculously,17-year old Juliane Koepcke survived the fall of 9,200 feet while strapped in her seat and, despite her injuries, walked for 11 days through the Amazon jungle until she was rescued. It was later determined that as many as 14 people survived the fall but died awaiting rescue.