Of course you can!
Tampons function the same for both virgins and sexually active people. The female hymen is elastic enough to support a tampon without causing a rupture. Tampons may feel harder to insert when you are a virgin, this is why picking a smaller size and having patience and relaxing while putting the tampon in, will make the process smooth and easy.