Creatures which are immune to fire take no damage from firebolts and can wade through lava safely. They can never be burning unless they are an everburning type of monster like the salamander.
Fire immunity does not provide protection from steam or explosions.
The only way for the player to become immune to fire is by drinking a Potion of Fire Immunity. This effect wears off after 150 turns. Allies can learn permanent Fire Immunity from the corpse of a Fire Immune creature.
Fire immunity, whether temporary or permanent, will be removed if the creature is negated. If the creature is standing in lava, it will be instantly consumed - this can even be used to kill Dragons, but will also work on you, so beware of spellcasters when lava wading.