Is it possible to do it?
Yes, you can reinstall OS X Mountain Lion.
If I run an antivirus scan after a virus has affected the system, will it be removed as in Windows?
Most probably yes, but you can never be sure. Same as with Windows, the only way to be sure a virus is gone is to reinstall your operating system. If you really care about your data and want to be a hundred percent safe, you will have to wipe your hard drive and start fresh.
Is it possible that viruses get installed through visiting some websites? I saw some tutorial that showed if we download or install something, a virus could affect the OS?
A virus can find many vectors to access your system. OS X is often the victim of attacks through Java vulnerabilities, so it'd be a good idea to disable Java if you don't need it.
Often though, and I would say in most cases, a system being infected is the fault of the user sitting in front of the computer. If you download an executable file that happens to be a virus, and run that, you'll be infected as well. This is why OS X prompts you every time you open a downloaded file that could potentially harmful. Do you trust the source? If yes, open it, if not, don't.
Normally, any executables you run should not have permission to change anything on the system in a large scale. A virus could delete files you own or potentially read private data, however it will not be able to completely wreck your system unless you've given it
root permissions. Basically, you do that by entering your user password. Never enter your password if you're not sure what you're entering it for.
That being said, just visiting a website is not dangerous per se. Often though, malicious websites make you download infected executables – however most of these are targeted against Windows users, since it's the most popular platform.
Keep it cool and … most importantly: Don't visit fishy websites. The words "warez", "cracks" and "serials" should make you suspicious, as well as anything claimed to be "free" when it normally costs money.