The brain itself cannot feel pain, it can only receive pain signals from other parts of the body. Pain certainly can affect the brain, though. People who have chronic long-term pain can actually experience a type of brain damage in which the neurons that are responsible for pain perception fire so much that they injure themselves. This can makes the sufferer more likely to be depressed, have trouble making decisions and experience anxiety. These changes to the brain structure reverse with treatment or as the body recovers.
More facts about the brain and pain: