Absolutely! I exercise more than usual on the days that I have strong leg pain. First of all, I want to tell my brain that I'm not falling for it's tricks. Second of all, the exercise promotes greater blood circulation and a dramatic elevation of mood which both contribute to pain relief.... I have never felt worse after exercise and almost always feel much better for many hours....Of course, if I was locked into place by severe back muscle spasms (which did happen to me for a couple of days many years ago), I would rest and take pain killers.
I agree... The pain becomes a challenge. More often then not, once I am engrossed in the exercise, the pain subsides or goes completely away as I am no longer dwelling.
When I keep busy, I have less time to focus on pain.