Torrents, P2P's and general file sharing sites are the best way possible to get the absolutely worst malware out there. Such as key loggers, back doors, root kits, ransomware, etc.
That's where criminals put it, on purpose. It's very well known to be the number one way to get your computer infected with the worst malware out there. They load up illegal versions of Photoshop, Mathematica, and other such software with extra installer packages. Once you give your admin credentials to install the cracked/hacked commercial software you think you're getting for free, the malware gets installed with it. The installer doesn't need to ask for your admin password again to install what you weren't expecting.
But yes, if you install torrents (Not all downloads from them are illegal, of course. But most are.), then you easily could have installed Flashback packaged a different way. What's patched against is the original method. That was by visiting an infected site and having Java for the web installed. Your Mac would be immediately infected through the security hole in Java. If you didn't have Java installed, the site would beg you to enter your admin password. Cancel the request, and it couldn't do anything.
Nothing can stop Trojans, other than the user. That's what virtually all Mac malware and adware is. AV software can't stop it since it doesn't know if what you have is malware until after you install it. Only very occasionally will AV software even tell you it found the malware you installed from a Trojan download. Most of the time, it doesn't even do that. I've seen the EtreCheck reports of multiple users here who have up to four different AV titles running at the same time, and their Macs were still loaded with adware and worse.
Can Macs be infected? Sure, it's a computer like any other computer. It's just a lot harder to infect a Mac since there has yet to be an actual virus in the wild (malware that installs and spreads without any interaction by you required). It's all Trojans, which requires the user to do something before any infection can happen.