What you are refering to is called proalgesia, or a proalgesic effect.
Many drugs can have this as a side effect. Opioid derivatives, when a tolerance is built-up can noticably cause pain in withdrawal. This is because the body compensates (homeostasis) for the blocked pain-receptors by the release of peptides which are part of the anti-opioid system (orphanin, neuropeptide FF, tripeptide melanostatin and others).
Similarly, intramuscular GABA (related gabapentin and pregabalin are used to relieve pain in neuropathies) a study found that injections in the masseter muscles of healthy volunteer subjects was found to cause more pain than the saline control, and the addition of lorazepam or algogen glutamate were also observed to increase pain levels further.
Nature has evolved substances which cause pain such as in bee-stings (apitoxin), the main pain-causing ingredient of which is a peptide called melittin, which is used in traditional remedies for various ailments despite limited research into the broader effects of its toxicity.