I'm not sure of the origin of the idiom, though I believe it to mean a single-function or single-use person, animal, or object. It's often used after a lackluster or anticlimactic event in my experience. Perhaps the origin lies in rodeos of the American west or carnival shows?
Merriam Webster online corroborates my definition. https://www.merriam-webster.com/dictionary/one-trick%20pony
Also according to Merriam Webster, its first known use was in 1980.