No, you should not compost tampons.
While the absorbent material is usually mostly cotton, some brands include synthetic fibres in the pad or in the string so they will not breakdown. Even natural, unbleached, 100% cotton tampons will take a long, long time to compost down – giving any bacteria or pathogens a perfect opportunity to breed.
However, the blood itself, while fresh, is a great source of nutrients for the garden: if you fancy it, wash them out in a bucket of water and pour straight onto the garden (or onto the compost heap – as long as it doesn’t get overly wet) to reuse the goodness. Alternatively, cut out the middleman – try using a divacup or mooncup instead of a tampon.
Menstrual cups (eg Mooncups) save a huge amount of waste from going to landfill. You’ll save a lot of money. My Mooncup has worked out at £3 per year so far. You can barely get a bag of tampons for that.