Composting tomato plants is a bit of a contentious subject: some people do it every year without problem but the thought of composting them makes other people smash things in a rage.
The plants are, obviously, just vegetable matter so they will compost down but in a basic garden compost heap, it’s probably better to avoid them.
Tomato vine stems can be a bit tough, so don’t break down as quickly as everything else around it (some people combat this by shredding them first) and seeds from stray tomatoes left on the vines at the time of composting might lead to rogue plants cropping up wherever you spread the compost – if they weren’t worth picking, chances are their children won’t be either.
Most importantly though, most basic compost heaps won’t get hot enough to come close to killing diseases or mould/fungal spores that the plant maybe harbouring. Some problems can linger in the compost for several years, potentially causing serious damage to future crops – not just tomatoes but other plants in the Solanaceae (nightshade) family too (including potatoes, bell peppers and chilli peppers, and aubergines/egg plants).
So in brief, you can compost tomato plants but if you’re new to composting, you’d probably be best not doing so.
Also see: Can I Compost Tomatoes?