In both situations, a subject is voluntarily exposed to a noxious, anxiety-producing or otherwise aversive stimulus for the purpose of overcoming the subject's strong response to the stimulus. There may be other similarities, but no others are coming to mind.
Emdrgreg