So yeah, not only you can buy a PC without an OS, you can even buy a DELL PC without an OS. You just may have to go directly to the manufacturer.

In the linked conversation, the salesperson explains that they don't generally sell the PC without an OS because they don't want people to be surprised. Furthermore, he explains that not all of their PCs may be tested with whatever OS you intend to install on it. But he does agree to sell him one.

It's not illegal. There may, in fact be contracts between the manufacturer and whatever store is selling that PC to sell it with the software that the manufacturer specifies. But that's different (And, in any case, breaking a contract is not identical to breaking the law).