Dogs act in ways to get rewards or avoid punishment. It's not just humans dealing out these, but deep genetic training. Following the scent of an in-heat female gives pleasure to dogs, just like eating a fatty bit of liver. (Really, it's the same reason we humans are drawn to salty snacks, fatty snacks, and sweet stacks...plus sex, and I also think hunting)
Through breeding efforts certain hound types were created where the scent of certain animals was just as pleasurable to them as a choice cut of fatty meat or an in-heat female. Beagles with rabbit-scent is an example of this. They go into a doggie-high. Rabbit scent is beagle-heroine. It takes a LOT of outside influence to snap them back into paying attention to the rest of the world around them. It's enough different so a dog who sees something they really want to interact with will still remember how long the leash is, but a dog in the throes of something they have deep programming for, yea, they'll not have any regard for how long the leash is, they'll barely notice when the leash finally stops their forward progress.]
Of course many of the hound breeds like the beagle have been raised as family pets for many generations, and so the scent-lock has diminished a lot in certain individuals.