The earliest recorded use of the phrase dates back to the middle of the 19th century, though it had been in use earlier with 'horse' replacing 'donkey'. Even 'dog' has been the poor suffering animal, too.
It was referred to as an "old vulgar hyperbole" as long ago as 1808. Clearly, therefore, it has been around in one form or another for a long, long time, making it almost a sort of 'proverb'.
Perhaps the idea is that people who do talk incessantly - not caring whether they are talking to a human being or<.i> an animal - even bore the poor creature to such an extent that it is forced to sit down in the end...ie it no longer needs its hind legs.