The result of heating the nut is  the expansion of the gap between the bolt and the metal edge of the hole and thus the reduce of the friction force between the two surfaces.
You can find some excellent answers here:

https://physics.stackexchange.com/questions/12599/will-a-hole-cut-into-a-metal-disk-expand-or-shrink-when-the-disc-is-heated