You are correct in that the neurons themselves do not sense pain. However, the brain contains layers of coverings, blood vessels, the scalp and some muscles. All of these other structures have pain receptors. The coverings of the brain are called meninges and consist of the dura, arachnoid and pia. The dura in particular has a lot of pain receptors and may be responsible for many headaches. As a neurosurgeon I have seen this first hand during awake brain surgery when we open the dura. The patient usually doesn't report any pain when you drill a hole in their skull. However, thethey start to report dull pain or headache when you stimulate or touch the dura.