You confuse pain (which is a conscious feeling) with the response to potentially damaging stimuli.
If you burn your hand, your body reacts before you become aware of the pain.
That is what the discussion about pain. Amoebas don't have the consciousness to experience pain, because they lack the higher brain functions involved