This American slang term for horse dung or droppings originated in the mid 20th century. Clearly, the allusion is to the appearance of horse droppings which, in shape and size at least, although hardly in colour or odour, resemble apples. The first mention of the term in print that I can find is Berrey and Van den Bark's The American thesaurus of slang, 1942:
"Road apples, horse dung."
The first usage of the term is likely to be rather earlier than that though as that citation is predated by a reference to 'road apple' being used as a theatrical term. Bernard Sobel published The Theatre Handbook in 1940, in which he included a definition of a 'road apple' as an actor on tour. Sobel also listed many other theatrical terms which, although not widely known at the time - hence the need for his handbook, are commonplace now; for example:
Angel - a financial backer of a play
Turkey - a show that is a financial failure
Brush off - get rid of
Born in a trunk - born into a theatrical family
The theatrical use of 'road apple' appears to be intended to be ironic, which suggests that the 'horse dung' meaning of the term was already established by 1940.