For example, your home insurance would cover your house burning down but might have a clause along the lines of "if the whole town burns down, we will not cover you."
I'm guessing some health insurance plans have a similar clause of "if there is a WHO declared pandemic, we won't cover you".
The fire example from a real historical event: a German city burned to the ground and put multiple insurance firms out of business. This led to the development of "re-insurance" aka insurance firms that insure other insurance firms.
For an interesting take on the above plus catastrophe bonds in general (mentioned in another comment) I highly recommend this article by Michael Lewis: https://www.nytimes.com/2007/08/26/magazine/26neworleans-t.h...
EDIT: changed "would have" to "might have a clause"