I'm not going to wave the flag for Microsoft, Bill Gates has enough money to hire people to do that. MS has its share of bugs and is frequently hit by viruses and worms. The reason is not because of the structure of their programs, but because they are the most popular programs on the market.
That's only one reason. Ultimately, the structure of MS's programs isn't great either.
The low-lifes out there who think it's funny to spread viruses, pick on MS because they can affect more people than by building a virus that would affect Firefox or Opera, or Safari. I imagine that when Google begins to increase in popularity they will get hit with a virus.
People don't make viruses to affect web browsers--they make them to affect operating systems. If you're on Windows, you can get the same virus through IE, Firefox, Opera, or Safari. A web browser generally isn't going to protect you from viruses so much as it's going to try to protect you from trojans, hacking, and phishing.
Google has no operating system (other than Android...but that's a phone OS) to hit with a virus.
The other thing you should think about, is that MS has literally legions of programmers. These programmers immediately go to work to fix the vulnerability that a new virus or worm has uncovered. Do the makers of these other programs have that response capability?
Well, Gecko (Firefox) and Webkit (Safari/Google Chrome) are both open-source projects. That means every programmer in the world can potentially fix whatever vulnerability has been found. So, these other programmers have millions more programmers to respond. Webkit and Gecko are both updated nightly (these nightly builds aren't incorporated in the major public releases as quickly, but are available to them) so they any vulnerability can potentially be fix in less than 24 hours.