To put it simply, if you got a virus on Windows, it wont affect your Mac one bit. It will only affect Windows. So lets say you got a virus on Windows: if you wanted, you could erase Windows off the computer (taking the virus with it) and the Mac side of your computer would be fine, no problems at all.
Thats why when you hear Macs dont get viruses, its true. Because all those viruses that affect PCs dont affect Macs one bit. So if you want to install Windows, go ahead even if you got a virus, the Mac side and all its files will be working perfectly, waiting for you to use them.