Of course it is possible to write a virus for Macs. Don't believe anything what Steve Jobs say. Macs are based on the same Neumann architecture like any other PC, so it is possible. Traditional viruses write themselves into the executable files, that's how they are executing their code, and that's how they spread. That's why you can't spread a virus with a pure html page
(sorry for ruining many people's beliefs
). I don't know much about viruses, but you will have to know low level C, or ASM for it (Macs have intel based CPUs now, so you can use x86 ASM).