Usually, masturbation does not cause any pain. If you feel any pain while masturbating, it is not always due to any medical issues. It could be due to bad-fitting sex toys. However, it is better to consult your doctor if the pain persists.