Please note that there is a difference between something being illegal and it being a breach of contract. There is a possibility, depending upon what country you are in, that using OS X on non-Apple hardware is a breach of contract. But in no country is it illegal per se.