Leaving Docker APIs exposed to the internet could lead to some troubles like data loss, cryptomining, botnet and so on.
By default when you install docker on a host, you can access the docker API only from the loopback interface. This is great but apparently for some reasons you might want to expose those APIs in order to use some external tool like Portainer. Portainer is a lightweight docker management UI, you can run it locally attaching it to the docker socket or you can manage the containers hosted to a remote host.
If you have an API that doesn't have any authentication mechanism, set an authentication mechanism immediately.