Masterbation/period

Can you still rub yourself if you have a tampon in or is it not recommended!!!