At my last count there has been only one virus written for Mac OS X, and that was totally harmless. But it does prove it can be done.
I'm sure there were a few more for Classic but I never really had to deal with that so you might want to Google it. Also, this page seems interesting:
http://antivirus.about.com/od/macintoshresource/
There's a link about 2/3 of the way down the page that seems promising:
http://www.icsalabs.com/html/communitiesantivirus/macintosh/archives/macvirus/reference/viruses.html
Mark.