Hamachi allows you to create a VPN. Think about it as sharing the same wifi with your friends.
Why would you need to have a VPN to host your Minecraft server? So you can bypass your router’s firewall and NAT.
A firewall simply serves as a way to drop incoming or outgoing connections on certain ports. Usually, firewalls come preconfigured in computers and routers to drop almost all ports (except for some which may be required for certain things to work) and requires to manually open ports when needed.
A NAT (or network address translation) serves as a boundary between your home network and the rest of the Internet. This is why your home network has a ‘public IP’ that’s the same between all your devices, and each of your device has a unique ‘private IP’. If you’re familiar with the term ‘port forwarding’, this basically means that you’re telling your router ‘if you receive a connection to port 25565, please forward it to the machine with IP 192.168.100.10’. This is necessary so people in other networks (their own home’s wifi for instance) can connect to your service in your own network (your home’s wifi).
You may have heard that opening default port values, (or any port for that matter) might be dangerous. The reason is, you’re opening your machine for anyone to connect through that port. This doesn’t necessarily mean that a hacker can get access to your computer just like that. It usually involves exploiting a vulnerability in the service that you host on that port that may grant them a certain access. For example, imagine that a server for Minecraft 1.0.0 has a remote code execution vulnerability that occurs when you connect 10 times in a row, if you were to host this server and an attacker discovered your service’s version, they may try to execute an attack to exploit that vulnerability.
For this reason, it’s ideal to avoid exposing our home networks as much as possible.
Now, with Hamachi, (or any VPN for that matter), you’re creating a new network to connect your machine and your friends’ so that they can talk directly together. This means there’s no NAT involved, no port forwarding, and most importantly, no firewall. If you trust your friends, there’s nothing to worry about. If you decide to invite other users to your network, you’d have to think twice.
Think about it this way, would you let strangers connect to your wifi? The reason we secure our wifi networks is to avoid sharing a network with potentially dangerous users since being in the same network (especially a home one) usually means that the computers can talk freely between each other.
Also, check out ZeroTier, from my experience, especially for games, has been much better than Hamachi.
TL;DR: If you trust all the users inside your VPN network, there shouldn’t be a problem. You also don’t need to change the default port, but you can if you prefer.