This can happen during colonic exploration, as a result of the electrical nature of a colonoscope.
A colonic gas explosion is rare;[1] however, the result can be acute colonic perforation, which can be fatal.
[1] An explosion is triggered by a combination of combustible gases such as hydrogen or methane, combustive gas such as oxygen, and heat.
An explosion can also be caused by Crohn's disease.
[1] Careful bowel preparation, such as cleansing the colon before a procedure, is key to preventing an intracolonic explosion.