Pain perception can begin at free sensory nerve endings in the skin that act as nociceptors for potentially damaging stimuli.
High temperature, acid or chemicals such as capsaicin open stimulus-sensitive channels for positively charged ions. Ion entry depolarizes the ending; if threshold is reached, action potentials travel along the sensory neuron to the brain, where pain is perceived.
Sequence: damaging stimulus → positive-ion channels open in free nerve ending → depolarization reaches threshold → impulses propagate to brain → conscious pain perception.
Capsaicin in chilli peppers activates ion channels in free nerve endings, producing depolarization and impulses that the brain interprets as burning pain even without high temperature.
Nociceptor activation is the neural input to pain, not pain perception itself. Conscious pain emerges after processing in the brain.