Yes you definitely can. It’s possible with both VirtualBox and VMWare Player. Google around, there’s work to do.
It’s been my experience that VirtualBox has some issues (e.g. clicking ‘About This Mac’ causes a logout). In both cases you won’t have accelerated graphics. And yes you can any run XCode. I went with VMWare Player, works fine although Mountain Lion seems more laggy than Snow Leopard.
I’m not sure it’s illegal to run a legal copy of OSX on non-Apple hardware, but the EULA doesn’t allow it. (IANAL)
solved Can i install Mac system in Windows? [closed]