Like Pakey said it's only pokemon with the Flame Body or Magma Armor abilities.
The reason those abilities help is because they keep the egg warm, which is what eggs in the real world need. That's why birds sit on their eggs in nests, to keep them warm.