Yes, there are two as I know of, let me quote them as follows:
(1) to calm horse:
It involves the whole horse--a thoroughbred horse to be exact. Because of breeding, thoroughbred horses tend to be very jumpy, nervous animals. Goats are the exact opposite, tending to be calm and unshakable. Someone noticed this contrast and wondered if the goat's demeanor would have a calming influence on the horse. As a test, a goat was put into the stall of a thoroughbred horse. As hoped, the horse calmed a bit AND, most importantly, the horse ran better in the next race.Next thing you knew, all thoroughbreds stalls had a companion goat.Soon some unscrupulous owners began kidnapping (pun?) the goats of competitor's horses, hoping the disruption would help their still goat-calmed horses to win their races.Out of this practice came the phrase "to get one's goat."
(2)two lonely men
It began as American prison slang, which in turn came from an off-color joke. The joke: Men stranded on a desert island find a herd of goats. Being starved for love, they have sex with the female goats. This goes on day after day until one day a fight breaks out between two men. When asked to explain, one man points at the other and shouts angrily, "He's got my goat!" That's how the expression began.
I think the first one is more reasonable. The second one, I feel, is made up. Anyway, no matter what, it shall serve your curiosity.