Well, it's complicated. Here's the Cliff's Notes version:
For one thing, the Unix permissions structure that Mac OS X (like all Unix-like OS's) uses is very strong. No program (virus/worm/trojan) can modify a file without permission. Since the System is protected by a very high permission threshold (called "root") it is very difficult to infect.
Besides that, Macs are less common. Which means three things: firstly, that there are fewer people who know enough about them to write viruses/worms/trojans; secondly, that there are fewer potential victims, and thirdly, that it is much harder for viruses (etc.) to spread. (Remember, it's a chain reaction: one machine infects another, which infects another. On a platform with 95% market share, this is easy; when you have only 5% or less, it's much harder to find the next link in the chain.)
NOW. That said, there has been one (Yes, one) confirmed case of a Mac trojan. It was a simple program that deleted files, and was spread on filesharing networks (Gnutella/Limewire.)
1. You first had to download it manually using Limewire
2. You then had to double-click it manually
3. Because of the OS X permissions system, it would only delete files belonging to the User who double-clicked it. Meaning, other Users' files, and the OS itself, were completely unaffected.
4. It would not run again unless the you double-clicked it again. (Since it had no way to infect the OS itself.)