In the 1812 Overture, the bells and cannon are coordinated with the rest of the instruments so it isn't so abrupt.
I've lived in places where people shoot off random fireworks on New Year's, Independence Day, and other holidays, and sometimes there are huge fireworks displays you can hear across town, and those can suddenly break in while other things are going on!