The physical stimuli for touch are mechanical, thermal, and chemical energy that impinges on the skin.  The skin has at least 6 types of sensory receptors, which are routed throughout the spinal column to the brainstem.  There, they cross over mostly to the opposite side of the brain, and project through the thalamus and onto the somatosensory cortex in the parietal lobe.
Temperature is registered by free nerve endings in the skin that are specific for cold and warmth.
Pain receptors are also mostly free nerve endings which transmit information to the brain via two types of pathways...the fast pathway that registers localized pain and relays it to the brain in a fraction of a second, and the slow pathway that lags a second or two behind and carries less localized, longer-lasting aching or burning pain.
Gate-control theory holds that incoming pain sensations must pass through a “gate” in the spinal cord that can be closed, thus blocking ascending pain signals.