No, it does not sound like an STD. Yes, rough masturbation could cause it. I advise avoiding too much friction, applying over-the-counter 1% hydrocortisone and moisture lotion, and showing your rash to a doctor for definitive diagnosis and, if needed, treatment.
Best.
Dr. Rockoff