Here is how shock sensors work:
It is a little vacuum tube with 2 very light gauge wires in parallel. When something shakes the tube (or whatever the tube is attached too, quite often the dashboard of the alarmed vehicle) - those light gauge wires vibrate too - often touching. There is logic on the alarm to only "pre-alarm" which is to not go off half-cocked, just let a little yelp or two out. The idea is to scare off the kids who bumped into your car without going into full blown alarm panic.
Often thunder is very violent and contains a lot of deep bass (well below hearing threshold, which is why you often feel thunder). This trips the shock sensor for an extended period, leading to all out alarm.
Also some alarms have glass break sensors, which are mics tuned to a particular frequency. Thunder often overloads them.
I used to set off alarms with my 89 firebird - its exhaust was pretty much cosmetic.