It's not especially dangerous to keep batteries in the refrigerator or freezer, but they should be warmed up to room temperature again before installation. If batteries are stored in the refrigerator, they should be carefully packaged to keep them dry; alkaline batteries may leak potassium hydroxide if the outer cover becomes corroded. There is a popular myth which suggests consumers should keep batteries in the refrigerator or freezer to extend their shelf life. In reality, the benefit of storing batteries at a very cold temperature varies depending on the battery type.
Modern alkaline batteries do not benefit much from refrigeration or freezing. The enemy of most batteries is heat, which causes a higher rate of self-discharge, but simply storing alkaline batteries in a cool, dry place should be sufficient. Some types of rechargeable batteries, including NiCd and NiMH batteries, self-discharge more quickly, and may benefit from being stored at low temperature. Some experts also recommend storing lithium-ion batteries in the refrigerator at a 40% charge; they should not be put in the freezer.
One concern a homeowner may have about the practice of storing batteries in a refrigerator might be leakage or contamination. Many people have had the experience of changing out corroded alkaline batteries and discovering a caustic fluid on the casings. This fluid is the alkaline solution which encourages electrons to flow between the two metals and out the positive pole into the device.
Earlier alkaline batteries for home use were often formed from cardboard casings and a foil wrapper, much like a tube of refrigerated cookie dough. When the liquid and paper contents expanded over time, the seam would burst and alkaline fluid would leach out. Modern batteries use a metal casing to prevent such leakage and contamination.
If a consumer wanted to keep batteries in the refrigerator for long-term storage, the risk of an alkaline fluid leak would be minimal with modern batteries. It is always a good idea to make sure any type of batteries stored in the refrigerator are kept dry, however, to reduce the chances of corrosion. Batteries do not discharge high levels of toxic gases, either, so they would not contaminate the entire refrigerator cabinet's atmosphere.
While it may not be strictly necessary to keep all types of batteries in the refrigerator to extend their shelf life, some people may want to do it in order to separate newer batteries from older ones. The new batteries could be kept in their original packaging or placed in plastic food bags and marked with a date of purchase. A consumer could keep batteries in the refrigerator or freezer indefinitely, as long as there was some form of barrier between the batteries themselves and stored foods. As long as the batteries remain cool and not plugged into a device, there should be little to no chance of cross-contamination.