Azure DevOps and private Docker registry
To use any of Docker's tooling you need a Docker account.  Part of this is that Docker will use base images from Docker Hub to build images that may be stored in a private repository.
For the Docker ID getting permission denied verify that you used the ID and not your e-mail.
Microsoft and others have put together great documentation both Azure Pipelines and private Docker registries:
Introduction to private Docker container registries in Azure (will help you make sure it is configured properly)
Accessing Azure resources from a Dockerfile (useful since you may be trying to do something similar in your build pipeline)