Most people walk their dog, whilst their dog is completely oblivious to their existence. The dog is typically at the end of the lead, as far away from the owner as he can get, smelling scents or scanning the environment and getting all of their mental stimulation needs from that environment. These dogs have learnt to tune out the owner as they seek out their own personal fulfilment. Imagine trying to hold a conversation with your teenage child whilst they have headphones on listening to their favourite music, it's very similar. You first need to disengage them from the distraction and then engage them into your conversation.
Trying to train a dog that isn't engaged and is completely distracted by the environment is impossible. Many people try to train their dog whilst they are in this state of mind. We hear things like, “my dog is stubborn”, or “my dog has selective hearing”. The truth is, it's neither of those things. It's just that in the absence of any interaction from you, your dog has learnt how to entertain themself and now doesn't see any value in you, when in a distracting environment.
These dogs need engagement training, to tune them into the owner before you try to teach any commands. This is the exercise or exercises that teach your dog to keep interacting with you and to ignore distractions. These exercises teach your dog that all the fun and mental stimulation they need comes from you. Once you have your dog's attention training is easy.