There is no good answer to your question.
There are many ways to answer your question, but with each answer there would be a caveat and unknown factor which makes any opinion based on quicksand.
So, for example
- Least number of "bugs." The problem with this is that you're only able to evaluate what is known. Does a bug count if it's not widely known?
- Number of vulnerabilities. So, if a bug exists and it's also determined to possibly provide an attack vector, not only is this again based on what is publicly known but there are degrees of seriousness and mitigating configurations. What a mess trying to score the importance of whether a vulnerability is significant, serious or not.
- Number of exploits. Again, based on what is known.
- How easy is it for the SysAdmin to make a mistake? This is probably the main reason why many might consider Windows "more secure" than *NIX. GUIs and objects simplify admnistration leading to fewer mistakes and better security.
- Patching. All OS suffer discovered vulnerabilities over time and need to be patched. How difficult is it to patch? How reliable are patches? How quickly are patches released? Again, this is probably where Windows enjoys an edge over *NIX with its centralized management, reporting and accountability compared to the diverse world of open source and publicly licensed software.
- Attack Surface. Although the basic OS is the foundation, a computing machine normally runs a number of applications that require exposure outside of its physical boundaries. If you can't manage this exposure, the OS is extremely vulnerable.
- Memory Management. Things like overbuffer attacks have existed since the beginning of computing yet still exist today. A proper OS should not only not suffer from memory space vulnerabilities, it should also know how to protect poorly written applications from themselves (and everything else).
I'm sure others can come up with a longer list than this evaluating security, so basically any question about one OS being more secure than another is probably unanswerable unless each one was deployed in isolation, locked behind doors and communicating with no one or nothing... in which you would then say that every such machine was completely secure.