Yes it works to coax the animal to move, but probably not as means for consistent forward locomotion. Some evidence:
* Footage of a man "training donkey to move with a target stick/lure/feeder."1
* Amateur video showing a "pony move under saddle while being baited with a carrot dangling from a string attached to a stick."2
* From _Every Woman's Encyclopedia_, 1910-1920:
> Stick-and-carrot race. Each competitor tries to incite her steed to its top speed by dangling a fine carro' before its nose spirits of the place, who will be sure to enter into the fun, and make things go with a swing, before inviting the less enterprising boys and girls and smaller children.3
!enter image description here
1. <
2. <
3. <