No, they are not legal. Be aware of those KMS, some of them might include virus/malware that might damage your PC.