Minecraft offers a demo version you can try before purchasing the full game. If you're downloading the demo from the official "minecraft.net" website, then yes, it is safe to download, and your computer should not be at risk of viruses.