here's the thing about how people get viruses: antiviruses are designed to block known malware functionality, this is well known knowledge so why am i saying this?
the thing with windows is that it has limited sandbox functionality: you run a program and it only has access to folders with the permissions it is given.
if UAC asks you for administrator permission: that means the program is asking to do something outside of the permissions the program currently has. if you click yes, you're giving it permission to do it. the only way around this is to exploit a hole in windows to escalate to administrator privileges. this is also why steam doesn't ask for administrator privileges every time you try and install a game.
so if you open malware, it's likely going to ask for administrator privileges, clicking no will not get you infected. clicking yes lets the malware do what it needs to do, the user allowed this to happen and this is not a fault of windows.
mac os x has a system where you can drop a program into the applications folder, and each application is like a folder in program files on windows.
no program is allowed to leave this folder unless you install it using a .pkg or it requests a folder to save to. UNLESS you install it using a .pkg file which was almost solely used for drivers and system level software, this is where it asks for your username. i don't understand how .pkgs work in how it's idiotproof for macs so i'll let someone who can explain that better to do so.
tldr: idiots who allows everything infects computers not drive bys n stuff