I could make a much cheaper computer and install the Apple OS on it, but that would be illegal. Apple does not allow that as part of its license, not even for experiments by hobbyist.
Conversely, I always ask people who run a Windows OS in a VMware virtual machine if they have a legal license from Microsoft to do so, because like the above, that is actually required.
For Microsoft, as long as you acquired/bought the license legally, they’re just as happy as if you got a Dell, Dude!
Seriously, for them the pay is the same. Someone bought one of their licenses (for money, or the distributing vendor did).
Now, if you just installed it without having a license... That would be illegal.
You cannot buy the Mac operating system. It's not for sale. . . so you have a problem in making a modern Hackintosh.
The answer is yes. Microsoft is in the business of selling operating systems. Apple is in the business of selling hardware, not Operating Systems. Big difference.