Downloading is a "grey-zone", but no one that I know of got in trouble for that.
Uploading is not allowed, and the little seeding done while downloading a torrent is still illegal. Although getting in trouble is rare because ISPs are not allowed to give out user data to random companies.
The Internet Archive provides direct downloads for the content they host, so the fact that they also offer torrents doesn't really change the legal situation.