No offense, but there are sooooo many things that compete for your dog's attention daily, especially out on walks. You may be lower on your dog's "Interesting List" than you might think.
Admire Your Dog From An Evolutionary Viewpoint
Succeeding in an ever-changing environment is a strength of dogs as a species. Their job as a species is to find food, avoid being eaten, avoid injury/disease, and live long enough to reproduce. In our modern pet-dog world, many of these skills aren't used in the same way for free-roaming dogs. But these evolutionary truths are still at work in your dog's DNA.
Embrace Motivation and Payoffs
We may want our dogs to do what we want just because it's easier for us, or because we're the humans and they're the dogs. This attitude will get us nowhere.
Dogs need motivation and payoffs for doing what humans want instead of what they want.
Behavior is expensive. Dogs are constantly asking themselves, "Is this worth doing right now?"
Behavior is not 100%. We can never guarantee that a dog will do something. However, the more times a particular behavior pays off, the more likely a dog will repeat it.
How-To: Start Getting Your Dog's Attention
Grab some treats. Start by working with your dog inside when it's quiet.
When your dog is nearby, say their name*. Feed them a treat, even if they don't look at you. Repeat 10 times. Do this for a few days.
Now, say their name, and wait for an indication they're interested. They may look up, stop what they're doing, or come close to you. Give them a treat. Repeat 10 times.
As the training progresses, start waiting until they are really paying attention before giving the treat. Once you're successful inside, try it outside in a quiet location.
*You may prefer to use a cue like "Check-In" or "Look" instead of their name., especially if people in your household use their name often without payoffs.