It was already in use by the 1590s. Thomas Middleton, the Ayckbourn of his day, has a comedian in The Mayor of Queensborough say: "We have a play wherein we use a horse," to which the mayor replies: "Fellow, you use no horse-play in my house," pointing out that he has just had the floors polished. Horses on stage can certainly turn serious drama into farce, but I rather think this was a pun (and how they loved them!) in which case there would have been no point to it unless the two meanings (a play with a horse or two in it, and what the OED calls "rough, coarse or boisterous play") had arrived independently of each other, as it were, horses being just as large and vulgar off the stage as on it.
Why, though, is the noble creature and willing servant so often associated with coarseness? It cannot be just because stallions are symbols of sexual prowess, though sex is always good for a leer or a chuckle. A horse laugh is not accepted in polite society. But I doubt whether any self- respecting horse would want to model itself on the policeman from Moorbottom.