In the courthouse scene where Barney is demonstrating to Andy how well Blue responds to the dog whistle, the rope used as Blue's leash is tied to his collar in most shots. But in one shot in the middle of the scene the rope is off the collar and laying on the courthouse floor next to Blue. In the next shot it is once again tied to the collar.
A dog whistle requires one to place their lips on the very end of the whistle to make a sound, as the opening where the sound is emitted from is just a short way down the body of the whistle. The end of the whistle is open but does not make a sound, it just allows for air to pass through. Both Barney and the criminal, Sam Neal, put the whistle too far in their mouths to make a sound as the sound hole is covered by their lips or inside of their mouth.
During the portion where Barney is dragging the dog through the door for the first time you can see that somebody is holding the rope behind the door. they'll let it go and the rope will go straight and pull the dog in.