The only way you can be sure your computer cannot be hacked via the Internet is to not connected it to the Internet.
I assume you're wanting to connect to you computer with Remote Desktop Connection or SSH.
With either of these options, you'll need to forward port 3389 (for RDC) or 22 (SSH) for connections coming from your router's public IP address to your home PC.
Once you've done this, any and all connections from the outside world will be able to connect to your local machine. The security is now the responsibility of the application listening on the forwarded port.
It doesn't make any difference if you're using a dynamic domain name service or not. If a connection is attempted to your IP addresss (regardless of domain name) on the forwarded ports then those connections will get through.
If your router allows port forwarding for only connections coming from specific IP addresses then "any and all connections form the outside world" should be limited to those specific IP addresses.