I'm curious what is the exact meaning/usage of this phrase/idiom?
The OED has
colloq[uial]. to see a man (about a dog, horse, etc.) and variants: used euphemistically as a vague excuse for leaving, (a) to keep an undisclosed appointment; (b) to go to buy alcoholic drink; (c) to go to the toilet.
and that’s about right. In the usage I’ve seen in the US and English-language media, I would say it’s a little more common to use “horse” if one is actually going to the restroom and “dog” if one is just leaving for elsewhere. As Michael Quinion notes, though,
Now that society’s conventions have shifted to the point where none of these reasons need cause much remark, the utility of the phrase is greatly diminished and it is most often used in a facetious sense, if at all.
Where does it originate?
They don’t offer a separate etymology—it’s just part of their entry for “see, v.”—but their earliest citation is a year before the one given by Wikipedia, Dion Boucicault’s London-based 1866 play Flying Scud, where it’s used by a horse bettor as an excuse to escape a lawyer who has discovered he was previously paid with a forgery:
1865 [‘Red Club’ “Of Falling In and Out of Love” The] Anti-Teapot Rev[iew] 15 Nov. [p.] 135
[We would suggest that there must be something very rotten in our present ideas of matrimony, if men allow themselves to be thus gulled by the charms (temporary only) of daughters who have no other recommendations than those which we have enumerated—viz., beauty, wealth, or accomplishments. If a man be fool enough to “fall in love” with either of these “baits,” so much the worse for the man; he, and his wife too (if he be unfortunate enough to obtain one), will come, in the course of years, to acknowledge that the hasty “love” of “sweet seventeen” is no guarantee whatever for a life of true happiness and contentment. The wife of 35 will ask how it is that she is no longer the queen she was years ago, when there were lots of suitors ready to “win” her (as she thought) at any price.] The husband will [meekly excuse himself from offering an explanation; feel himself henpecked; and twice a week, at least, will] find that he has to absent himself by going to London, to “see a man about a dog,” or on some other important business.
Now, it’s odd to make appointments to see anyone about a dog but rather common—among a certain crowd and especially in Ireland, Britain, and amongst their diaspora—to see men about horses: namely, to place a bet. (There’s dog racing, sure, but it’s always been a less popular affair and wasn’t really a thing until after the 1870s.) It’s possible that the phrase began among race hounds who found “seeing a man about a horse” was a little too on the nose and just reached for another animal known for its swiftness.
More likely, a generic excuse about needing “to see a man” has been around for ages, albeit the OED’s first cite for it is the 12 Sept. 1867 issue of The Ball-Players’ Chronicle.
Victorians and Puritans being how they are, the dog bit then started as a humorously oblique reference to visiting a publican for some of “the hair of the dog that bit me.” That turn of phrase has been a thing in English since well before the 1540s, when it’s first attested, already part of a list of immemorial folk proverbs. “Similia similibus curantur” (“Like cures like”) had been a thing since antiquity and a “ridiculous” folk cure for rabid bites was literal hair of the dog. By analogy, wags proscribed an identical “cure” for the frothy-mouthed ale knights dealing with hangovers—another drink. On that reading, the Anti-Teapotist above would be drinking his marital dissatisfaction away (a common enough practice, if an unhelpful one) and Boucicault’s bettor’s painfully insincere excuse would also be revealing a drinking problem to go along with his other vices.
Reference to excretion is obviously not intended by the early sources, but the great success of Prohibition—no, seriously: even with the recent uptick because of the Great Recession cirrhosis death rates have remained about ⅓ their previous level since the ’20s—reduced the social stigma of drinking. Left with a fun excuse and no reason to use it, its use changed:
Alan Dundes & al., “Kansas University Slang: A New Generation,” American Speech, Vol. 38, No. 3, Durham: Duke Univ. Press, Oct. 1963, p. 174:
There are some surprising historical changes in meaning. For example, see a man about a dog was a Prohibition euphemism for ‘buying liquor,’ whereas several contemporary students recognized it as a circumlocution for ‘visiting a rest room.’ See Sagarin, The Anatomy of Dirty Words, p. 71.
and that revitalized the expression and added new popularity to its twin, “seeing a man about a horse,” which has been attested since at least 1891 but in its new meaning offers humorous reference to needing to “piss like a horse” which has been around since at least 1969, became popular in the ’70s, and became “piss like a racehorse” around 1982.