Doctors and other medical professionals don't recommend actually putting ice on a burn because if you put ice on a burn it supposedly can cause frostbite and damage the skin.
However if you want to put ice on the burn be sure to wrap it in a paper towel and use something such as a plastic Ziploc bag to put the ice in.
You don't want to put the ice directly on the skin for a burn or for anything else because it can cause frostbite.
You should however put cool water on the burn by running your burn under a faucet with cool water which helps to soothe it.
If you do put ice on the burn you should put the ice on the burn for a few minutes at a time.