“Is it okay to masturbate after being treated for an STD?”
Yes, as long as you are not mutually masturbating with your partner. Also, always remember to wash your hands immediately after masturbating to avoid the possibility of spreading the infection, for example to your mouth.