Yes, and the assumption is that a horse is worth between $0 and some number so there is never a reason to refuse a gift horse.
In the case of other "gifts" the value can be negative. The trojan horse, software, and blankets from Lord Jeffery Amherst all need careful examination.
The winners apparently write both the history and the idioms. The Trojans would have done well to look a gift horse in the mouth.
A wooden horse can be full of physical soldiers and a digital horse with legal ones.