Well, given that the core of OS X is darwin, and Darwin is open source, well yes you could, it is even legal. A few people did just that with the PureDarwin and OpenDarwin projects.
I agree it would certainly be a lot easier to start off with something like Darwin or FreeBSD in a virtual machine to play with and modify/break, than trying to start out from scratch without any experience in operating system design.
Back in the 80s when an OS wasn't expected to do much (like DOS), writing one from scratch would be a lot easier.
I think its an example of just how much work and complexity is involved that it took apple several failed attempts (and they ended up buying NEXT back off Jobs to turn it into OS X) to replace the original Mac OS.
IMHO the only reason to write your own quick and dirty "OS" these days is if you want to program the machine to do a single task as quickly as possible. Essentially you're BYPASSING any operating system and doing everything yourself. E.g., many games in the 80s and 90s for stuff like the Amiga, Atari ST, consoles, etc used to do this. Positive: You have no operating system sucking CPU power you could use for your app. Negative: YOU are responsible for all low level device access - no drivers, no graphics libraries, no UI, etc are available. You're on your own.
Otherwise (if you want to run other people's software in a multi-tasking environment) writing an efficient scheduler and memory manager is not a trivial task to undertake. Even Windows, Linux, OS X and FreeBSD are having regular changes and tweaks made to improve their schedulers and memory managers, after several decades of real world use and refinement. And that's before you even get to the user interface stuff.
Not to poo-poo the idea, it's how Linus started out with Linux, and many others created operating systems before him - but to make anything even remotely comparable to OS X (or even Linux) will take many people a long time, even if they're good, experienced programmers.