There are a couple of flaws.. very specific models and attack vectors which make it pretty unlikely.
See http://www.zdnet.com/article/symantec-confirms-existence-of-unpatched-rootkit-ap ple-mac-security-flaw/
rootkits can get into any of the Unix type OS systems. And yes, Time Machine would also back it up just as windows would backup a flaw..
But mostly when you restore, you will simply select a date before the virus installed and that will bypass the issue. Or migrate your user data onto a clean install.. the virus will be part of the system files so will be left in the backup.
Overall, after I abandoned ship at vista, never had a virus infection. Using several different Macs and continuously online.
I worked as a computer technician.. and still do the occasional install of windows for people.. just recently did a win 8.1 install. It got infected within a week running standard windows anti-virus software but the people downloaded music from less than legit sites lets say. They rang me again a month ago to say it got infected again opening an email.
Stick to good computing practice.. Don't go to websites with illegal stuff of any kind. Don't open dodgy looking emails .. especially with attachments.
The Mac is still head and shoulders above windows.. if you are really still paranoid you can run an anti-virus in the Mac.. but they tend to be more for removing windows viruses that come in emails.. than having anything to do with the Mac.