In the game, Chip is a small, sentient creature who gets separated from Sonic and his friends while they are fighting against Dr. Eggman. Chip then gets captured by Eggman and forced to use his powers to create the werehog transformation for Sonic.
Chip never willingly goes into lava or any other dangerous environment. He is generally depicted as a harmless, well-meaning creature.
It's possible you're thinking of another game or character, or perhaps you're misremembering the events of Sonic Unleashed.