The human brain itself cannot feel pain, but it is very much a part of detecting pain everywhere else in the body. Stub your toe and impulses are immediately relayed to the brain through the spinal cord. The brain tries to make sense of the event and often triggers responses elsewhere -- but it never actually feels the pain. That’s why in some cases, brain surgeons can perform procedures while a patient is still awake.
There are, however, pain receptors near the brain. The meninges (the coverings around the brain), the periosteum (coverings on bones), and the scalp can all sense pain. During awake brain surgery, also called an awake craniotomy, numbing agents are used, and the patient is sedated.
More about awake brain surgery:
Amazing procedures that science especially through medicine makes possible. Interesting.