If you are brain dead you cannot feel pain because your brain is not there to receive the signals.
In computer speak, imagine you had a sensor that had external power and continued transmitting input to the CPU- the signals keep coming in, but the CPU is switched off. No processing of pain, no sensation of pain.
End of story