Magnet links are also hashes, so when you retrieve torrent metadata from your peers from a magnet link that data will also be verified for integrity.
However, if the original torrent itself was made from malicious data then it’s still gonna result in malicious code on your system.
Interestingly though, it is probably far more likely that a torrent with a very low number of seeders is malicious, than that a popular torrent contains malicious data in the files you download.
I suppose it could still be possible that the malicious code sent by a peer was targeting a weakness in your torrent client itself though. And that they could get remote code execution on your computer that way.
The main thing I would worry about with torrents is that your IP could be seen in the swarm by one of the companies that monitor torrent peers on behalf of rights holders and send you a nasty demand for money and threats of legal action.
If you are connected to a server, the server is the only connection(and only one with a log) but with a torrent, there are multiple connections so multiple parties could be keeping logs.
Depending on how a file is split in the torrent, it could be possible to add malice data with a collision: https://www.mscs.dal.ca/~selinger/md5collision/