It turns out that the human brain does not have pain receptors like those in the skin or muscles. So the brain tissue itself cannot feel pain directly.
But make no mistake, headaches are still real. The pain usually comes from the tissue around the brain, such as blood vessels, brain membranes, muscles and nerves in the head.
That's one reason why doctors can perform certain brain operations on patients who remain conscious. Part of the brain does not feel painful when touched, although the area around it still needs to be treated with anesthesia.
It turns out that the human body has many things that seem simple, but if you study them further they make you curious.