This neurological response is known as nociception and a similar process has been identified in fruit flies but insects do not have nociceptors. read more
They seem to feel distress when put into a stressful situation, but we can't be sure whether they experience pain in the classic sense. Insects DO have brains and spinal chords, but they do not have a central nervous system like most other animals. read more