Pain pills can. Generally any pain pill can upset the stomach. But if you are breastfeeding correctly it should not be painful. If it hurts so bad you need to take a pain pill, then you should have a trained person (lactation consultant) assess what is happening, and she if the lc can help to fix it.
Depends on med. The NSAID meds like ibuprofen, Aspirin & naproxin can have a direct irritating effect on the stomach & aggravate existing gastric injury. They do not generally cause cramps & diarrhea that are part of the gastroenteritis pattern. Acetaminophen doen not appear to have this effect.