I found a how-to guide (not exactly a reliable source, I know) that claims that e.g. stretching your legs to the point of pain to increase flexibility also increases your general tolerance to pain:
Increase your pain threshold
The best way to increase your pain tolerance is to get used to it. Practice by inflicting pain on yourself, while trying to keep a straight face. Do this whenever you're alone, (it freaks people out). Don't cut yourself or prick yourself with needles, I just stretch my legs. It serves two purposes, it makes you more flexible and it inflicts a great deal of sharp pain for as long as you can bear it.
Is this scientifically valid in any way? Or would, let's say, doing leg press repetitions to the point of lactic acid burning be as painful as before?