This intriguing bit of culinary advice began circulating on the Internet in September 2011. Judging from the numerous posts we found online from folks who had tried this method of cooking corn, it does indeed work, producing nicely-prepared ears of corn.
However, that something works doesn't necessarily equate with its being a good idea. Coolers (also known as portable ice chests) are fashioned by placing insulating material between hard plastic inner and outer shells. They are not meant to be used as cooking vessels, and potentially dangerous chemicals could leach from the plastic used in their manufacture into the corn being prepared there.
The inner liners of coolers are typically made of polypropylene or reground polyethylene, substances not known to contain bisphenol A, the "toxin out to get you" that has been so much in the news of late. However, that ice chests liners don't contain BPA (a chemical commonly found in plastics that has been shown to promote human breast cancer cell growth as well as decrease sperm count in rats) doesn't mean they're safe to heat up. When heated, plastics can release some of the chemicals used to make them into the foods they encase. It is for this reason you should not cook or reheat food in plastic containers unless they are specifically marked "microwaveable" or "microwave safe." Likewise, you shouldn't send plastic food storage containers through the dishwasher's cycle, lest the heat of washing break down the plastic enough to allow chemicals to leach into foods subsequently kept there.
In a nutshell, yes, you can cook corn in an ice chest. Whether you should is another matter.