It’s legal to install Windows 10 before you activate it, but you’ll not be able to personalize it or access some other features.
Is activating windows with slmgr safe? No, it isn’t safe to use either kms activation or any other activation software, especially if they use (as you said) unknown host server because this will provide them a kind of backdore to your system by which they might track your files or sensitive information.