Suffering is the existential state of Samsara. In itself, "suffering" in this sense is not a "purification" of karma, per se....it is just as often a cause for further suffering. The only true and lasting purification of Karma occurs when one goes completely beyond suffering, beyond Samsara. Enlightenment.
But, if you're talking about "individual" instances of suffering--for example, the headache you're currently suffering-- that instance may, or may not, be a purification of karma. I understand Buddhism to say that the "cause(s)" of that suffering is/are karmic, for sure. But the actual karmic causes, of individual "coarse" sufferings--such as your current headache--can't usually be pinpointed by ignorant beings such as ourselves. There are several methods I can think of that involve using such "coarse" events beneficially. First, recognize the temporary nature of the event, which reinforces the impermanence of our situation. Bringing this to mind is a virtuous state, and is certain to be a "positive" karmic force. Second, if one knows "tonglen," or "taking and sending," one can use one's current headache as a focal point for "taking" on and condensing the suffering of others. If one is really practicing HYT in the Vajrayana, one can transform this, but I'll just let that alone. At our level, inviting suffering, while thinking that it will somehow purify negative karma, is folly. as Ron said, not a good idea to walk in front of a bus with the thought that we are purifying bad karma......!!!! There are instructions, and instances, where "suffering" can be invited, or entered into, on the path...but these are pretty advanced instances.