A bullet in a fire will react differently depending on whether the bullet is loose, stored in an ammunition box, or loaded in a gun. While the first two situations are not ordinarily dangerous, the third one can be, and firefighters take special precautions when dealing with this scenario. Ammunition boxes made of metal can also be dangerous in a fire.
Bullets in a Fire
When a bullet is exposed to sufficiently high temperatures, the shell case will burst apart but the bullet will not travel at high speeds or go very far if it is not loaded in a gun. The ability of a bullet to cause injury depends on the speed with which the bullet is fired, and much of this speed depends on the fact that the bullet is being forced down a gun barrel. A loose bullet or a bullet in a cardboard box will not have the additional pressure of the barrel, so while it may fire it will not do so forcefully.
Tests on Hot Bullets
In Episode 85 of the television show "Myth Busters," the danger of putting bullets in a fire was tested by placing .22, .44 and .50 caliber bullets in an oven and then turning on the heat. All of the bullets fired when they got hot, but none of them had sufficient force to shoot through the oven door. By contrast, bullets fired from a gun at an oven door went right through it. A similar test was performed on an open flame with the same results --- bullets dropped into the fire went off but were not dangerous.
Bullets in a Metal Case
When bullets are stored in a metal ammunition case or a metal box, they can become dangerous in case of a fire. The reason is that the exploding bullets --- ordinarily not particularly dangerous on their own --- will cause the sides of the metal case to expand and eventually rip apart under the pressure. The resulting shrapnel can be very dangerous. A firefighter was injured in 2010 by shrapnel that may have come from an exploding metal ammunition case. Firefighters often retreat to a safe distance when cartridges begin to "cook off" or explode in the fire, although experienced firefighters have reported that in most cases their coats are sufficient to protect them from being injured.
Guns in a Fire
When a loaded gun becomes hot enough, it can fire on its own. Myth Busters tested this in Episode 85, by putting a .38 in an oven and turning the heat on. The revolver fired the bullet through the oven door. Firefighters have reported cases in which loaded guns began to fire repeatedly in a burning house. In one case, the firefighters believed they were being shot at from within the house. They left the scene to avoid being shot and the house was lost. In this case, one of the bullets actually struck the fire truck parked outside.