Software is software. You're downloading shady software off the Internet anyway, but there's one key difference:
- Torrent sites (such as The Pirate Bay) usually have systems of trusted uploaders. These are marked with a green/purple skull next to the file in search results.
- A torrent with a large number of seeders (think: hundreds or thousands) is less likely to contain a virus because nobody honest would seed a malware torrent and it'd cost a lot to fake that many seeders across the world.
- Torrenting software verifies the integrity of downloaded data. It uses a cryptographic hash function for this so it's impossible for a seeder to send you a tampered file (that is different from the file you intended to download). When you use a torrent file or magnet link, it contains the hash of the file so if what you receive does not match the hash then the torrenting software will discard it.