Bad plan 99.999 percent of the time.
First of all, in many cases the people don't even really know if the other wants a pet. You can like an animal without actually wanting one for the next, say, 15 YEARS.
Second, even if you know they're looking, they are a better judge of what fits then you are. Say I'm looking for a new shepherd and my family knows that and they decide to buy me one. They don't know **** about dogs and I can all but guarantee I would NOT want the one they chose.
Third, even if I have my eyes set on a litter or even an individual in a litter, if I went there myself to pick the pup out I might change my mind. You never know!
So if it isn't a surprise and you're going together, then sure, no problem
Or if it's, say a betta fish. If someone buys me a betta and it's ugly, well, big whoop. I can go buy another and have two betta tanks or I can just wait a few years until the ugly one dies. Even if someone bought me a pair of mice or something... that might be annoying but not catastrophic.
Dogs are NOT good "surprise" presents.