Can you masturbate with a tampon in?

Obviously not vaginally but with clitoral stimulation. It seems to me like when you orgasm it could get weird with the contractions and the tampon being in.

Edit: Thank you guys. I don’t want to respond individually because I prefer to remain anonymous.