Very common for residential buildings - the house I grew up in in Ohio had an automatic standby back up generator than ran off of piped in natural gas. The idea was to protect against weather-related power outages. (Generally snow or wind causing trees to fall on power lines)
I’m not sure how common this is in commercial buildings. Mains gas powered generator doesn’t seem like a very good idea for anything critical.