Gaseous hydrogen is often used to cool the large generators in power plants. "Hydrogen’s low gas density, high specific heat, and high thermal conductivity" are listed in the GE link as the major drivers behind its use.
On the matter of explosions - hydrogen is not particularly explosive without oxygen present. The goal, then, is to provide a system that keeps the hydrogen free from impurities (air) by sealing it off from the outside air. The purity of the hydrogen in the system is constantly monitored, and in an emergency the gas is evacuated by CO2. It's also worth noting that while helium is not explosive and very similar to H2 physically, it is too expensive to use as a cooling medium.