Where does the Oxygen for the emergency gas masks come from?
On commercial aircraft the oxygen supply of the masks in the cabin comes either from a chemical oxygen generator or a centralized oxygen bottle system. The flight deck is always equipped with pressurized oxygen masks.

The chemical oxygen generators generate lots of heat when they are activated. When normally placed in their overhead compartments the heat is slowly dissipated. However, oxygens generators are hazardous when canisters are not in their appropriate place. The ValuJet Flight 592 crash into the Everglades on 11 May 1996 was caused by a fire after improperly packed oxygen generators in the cargo hold were accidentally activated. 

Pressurized oxygen bottles also are hazardous. Not only because the oxygen can turn a small fire into a blaze but if the high pressure bottles explode they cause substantial damage. On 
25 July 2008 an oxygen bottle installed in a Qantas Boeing 747 ruptured and propelled itself upward through the floor into the cabin.