Your specific questions
I understand that I obviously can get a virus by downloading and executing a .exe in Windows but how can I get a virus just by accessing a website ?
Your browser is executing code all the time (it is made of code). When it downloads web pages, that code is downloading and displaying arbitrary data (pixels, characers, etc).
Code is also data (at the processor level).
Since code is data, if your browser tries to execute the data (no matter what the file extension or format), it might actually run (if crafted correctly).
Normally your browser won't be so foolish as to try to run random data it downloaded. However, this can happen.
One way to do this is to form the data in such a way that when read, it will "leak through" and overwrite the data that makes up the browser's executable program. This requires the browser to have a bug (most commonly in this case, allowing a buffer overrun).
Do these viruses attack both Windows, Mac and Linux users or are Mac/Linux users immune ?
No platform we use is completely immune to bugs, because they are all using processors that treat data as code. This is simply how our existing computer architecture works.
The reason for this myth is that Mac and Linux have much lower adoption rates compared to Windows machines (at the desktop level). So desktop software on these machines is not as common a target for virus makers.
Viruses don't occur by magic, or by happen-stance evolution (as biological viruses do). It is software written by individuals, or teams of developers. And they want to target the biggest market share, the same way regular software vendors do.
As for whether one virus can target multiple platforms; All browsers are running different code, so will have different bugs (even the same browser on different platforms). But there are some code libraries that are shared across platforms. If such a library contains the bug, it is possible that the exploit could exist on multiple platforms.
But, depending on the type of attack made, a virus written for a non-Intel Mac might not work on an Intel Mac, and vice-versa, because they have different processors. For different processors, the data that represents the code has a different format.
When you're talking about a virtual machine or scripting language, though, attacks might be platform independent. That leads us to the next question...
Also, the more exposed a running piece of software (e.g. software running a server), the more vulnerable it is to attack.
In general, this is called Attack Surface
Exploits in general
Microsoft has a mnemonic for common exploit types, and they all have their own interesting properties, and different levels of software that they can attack - STRIDE, which stands for:
Spoofing (of user identity)
Information disclosure (privacy breach or Data leak)
Denial of Service (D.o.S.)
Elevation of privilege
But security is a big and evolving field. There is really too much information to completely answer all of your questions.