The built-in VPN can do that, but it only supports PPTP, L2TP, SSTP and IKEv2, all of which are complicated for a regular consumer and require a server/machine with a public IP to connect to.
There are third party VPNs, that are somewhat less complicated, but still require some networking/sysadmin knowledge and a public server, such as OpenVPN or Wireguard or pritunl.
Other 3rd party tools, that can achieve similar goals as Hamachi, are ZeroTier and also Parsec IIRC.