As I understand it Boxers/Martial Arts practitioners can never become immune to pain. Instead they learn to deal with pain better than the regular Joes.
So what do they do to deal with pain?
There are all kinds of places on the body where fighters can get hit (the nose, the jaw, the solar plexus, the thigh, the liver, the kidneys, etc.), and each one of those triggers not just pain but subconscious, automatic physical reactions and altered psychological states. The pain is really the least of anyone's problems in this situation. It's the other stuff, the subconscious physical reactions and the psychological changes, that really need to be kept under control if a fighter is to survive and overcome his/her adversary.
Consider a punch to the eye. Prior to getting punched there, your eye lids will close automatically, your head will flinch, and your hands will start to raise to cover your eyes or block the punch. These are innate reflexes that pretty much all humans have. Anything that comes close to your eyes will trigger it.
Now, when your eye takes a punch, it's usually protected by the eye socket. So not only did the flinch reduce some of the force of the incoming punch, the eye socket does as well. The result is bruising, but not the loss of the eye. This is the result of evolution.
But the initial physical reaction will be swift. Your eyes will both begin to water, including the eye that didn't get hit. It's not quite the same as crying, but physically similar. Your nose will start to run. The eye that got hit will see stars for a fraction of a second, followed by blurriness due to the increased tears and due to your inability to focus properly. Your other eye may also become blurry for the same reasons. You'll feel the pressure of the blood and water as it begins to rush into the damaged area, the result of inflammation. You may also become dizzy and lose your balance. And ultimately it will leave you with a bruise that will feel tender for the next week or two.
Psychologically, the result will be fear and panic. Your body's nervous system will cause your heart rate and respiration to go up a lot. Your heart will pound much more strongly. Your adrenal glands will begin to pump adrenaline and cortisone into your blood stream. You'll begin shaking. Your fine motor skills will be disrupted. You could get tunnel vision, if you're able to see at all.
These physical changes will amplify your mental changes, and those mental changes will in turn amplify the physical changes. All of this is one big feedback loop making things get worse and worse and totally out of control for you.
The result is temporary disorientation, inability to control your thoughts and emotions, and inability to fight back. Panic can ensue.
The actual pain is not all that significant. You feel a sharp pain for a second or two. Following that is just dull pain due to inflammation. The thing to realize is that it's all the other stuff that happens that makes getting punched a dreadful experience.
So, how can you deal with it better? How do fighters deal with it? Fighters have all been hit before. They know that it's not the end of the world. It doesn't shock them. Therefore, they keep their mind from panicking. And that stops the feedback loop I mentioned above. It means they can remain in control mentally, which allows them to make quick, intelligent decisions immediately after getting hit. They can avoid further damage and hold off their opponent long enough for the automatic physical reactions (such as eye watering and the inability to focus) to wear off.
Stuff like black eyes, bruises, and so on are the only things that will remain after the fight. Bruises aren't very painful. But broken bones? Cuts? Those are painful, especially broken bones, and will require medical attention. They'll give you painkillers, though, while they're patching you up.
And on this subject, if you get a broken bone during a fight, sometimes the adrenaline pumping through you can dampen the pain enough to allow you to ignore it and continue fighting. Many fighters report not even being aware of a broken bone or a small fracture until after the fight had ended. But in other cases, the pain of a broken bone is so great that you will simply be unable to continue to fight. No amount of mental preparation will help in those cases.
TL/DR: It's mostly mental. Keep control over your mind, and getting punched won't be so bad.
Hope that helps.
In general terms these are the ways I've dealt with different kinds of pain:
After small injuries from punches or sprains
Apply cold (in form of an ice pack) the day of injury, subsequent days apply warm (you can use a zip-lock bag with warm wather inside, covered by a towell; or any other especialized equipment for sport injuries treatment)
Apply topic anti-inflammatory drugs, better if applied just after injury. e.g. Ibuprofen, Diclofenac, Ketorolac. As topic drugs have less secondary effects on vital organs as liver and kidneys.
Trainning pain: When trainning you can experience different kinds of pain, mainly when doing hard stretching and forcing muscles.
Breath deeply and slowly. Is one of the best ways to dampen pain as it helps the brain release endorphine. This is supported by scientific research: The Effect of Deep and Slow Breathing on Pain...
Trainning, by itself, will augment your pain umbral over time, allowing you to overcome more and more pain, but not in a disparate way.
Finally a word of advice: Pain is a signal that your body is giving to tell you "Something is wrong, DON'T DO THAT!" Of course as a martial arts practitioner you want AND WILL have to overcome different kinds and levels of pain, but remember to never hurt yourself too much or your body will eventually pay for that abuse. Severe injuries may keep you away from trainning, from days or weeks to your whole life.
Hope it helps. Best of lucks in your trainnings D_S
You get used to it after a while. That's all there is to it. If you get hit enough times, you stop being afraid of it. The fear of getting hit is much worse than getting hit itself. Also, when the adrenalin is flowing you don't really feel pain. I finished (and won) a fight with a broken collarbone which I thought was just a slight sprain. It hurt like a mother the next day, but it was only mildly uncomfortable during the fight.
There are three major ways in which martial artists learn to deal with pain.
This is one of the more commonly cited methods. Basically, by being hurt repeatedly, you start to condition your body to continue on beyond the pain. You hurt, but swelling and stiffness is reduced and toy set aside the psychological reactions.
This is a bit more advanced, but it's possible to "put the pain aside" through active meditation. This is also how woo like hypnosis and acupuncture work to eliminate pain and nausea, essentially latching onto the placebo effect. They know it's the same methodology because there's a drug that disables the effect. It is more of an upper level thing, take some concentration, and can be dangerous because pain is how the body tells you to stop before you really get hurt.
This is more for midfight reactions, but one of the reasons martial arts rely on so much repeated drilling is that it lets you react even when you're not with it due to pain. When you get popped in the noise, your eyes will water and you will most likely not be able to consciously react. However, trained reflexes will have you guarding, or even counterattacking, without having to think. You can see this in MMA fights where a fighter will often keep fighting for several seconds after getting knocked out, sometimes enough to recover and keep fighting.
And, of course, afterwards, there is some benefit to things like massage to relieve cramping muscles and there are many traditional martial arts ointments that aid in healing. It's nothing mystical - you can get the same results with a massage therapist and/or something like Bengay - but it is something most martial artists get taught to use.