There's no evidence to support any historical use of a wooden horse of this kind, and the arguments for a historical Trojan War are very disputable.
The wooden horse was certainly not made up in the Iliad, though. The Iliad doesn't even mention it! But the wooden horse does get mentioned in passing in a couple of places in the Odyssey. And we do have artistic evidence from not long after the Iliad that shows that the myth was a popular one - things like this vase.
There's been some suggestion that the wooden horse distantly reflects an earthquake that may have damaged the historical city of Troy, Troy VIh, at a time that approximately corresponds to the date that the Greeks invented for the Trojan War nearly a millennium later. The idea is that the Greek god Poseidon (as conceived in the 5th century BC and later) was responsible for both horses and earthquakes. As theories go, though, it's a pretty dumb one - it's colossally anachronistic, for one thing, and for another, it depends on the non-Greek inhabitants of Troy VIh imagining an earthquake in terms of Greek mythology.