Scientists are not certain how the process works, but probably the brain makes a judgment based on the type and variety of stimuli being received. Stimulus to the nociceptors alone might indicate dangerous, extreme temperature. Together these stimuli define the sensation of a burn, rather than a pinch or cut. The central nervous system reacts to whatever the sensory system tells it is going on. Therefore, the pattern of activity from pain and warm nerve fibers triggers both the sensations and the physical reactions of heat, including vasodilation, sweating and flushing.
Most people think of the 'burn' of spicy food as a form of taste.
In fact, the two sensory experiences are related but are very distinct. They innervate the tongue the same way, but the pain system that is triggered by capsaicin is everywhere on the body, so one can get thermal effects everywhere. Some liniments contain compounds that produce similar temperature stimuli to the nerves in the skin. Menthol acts in much the same way as capsaicin, but in this case, it stimulates the fibers that register cold temperatures, not those that respond to warmth. The chemicals fool pain receptors whose real purpose is to register critical events, like damage to the skin and the inflamation that often results.