How to generate heat using a battery and a wire
Yes, it can damage or explode the battery.

The only safe way to do this is to select a wire such that its resistance is high enough to limit the battery current to a safe level. To begin, you need to read the battery's datasheet to determine what that safe current level might be.

Knowing the battery's voltage and safe current level, use Ohm's law to calculate the necessary wire resistance. The wire must be thick enough to safely carry the current and long enough to have the desired resistance.