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.