I'm with the others in this thread... it's rude to ask someone what they paid for anything, not just their beloved pet. Luckily I've only had one stranger ask me. At the time, I was so startled that I answered truthfully. I won't be caught off guard like that again.
Anyway, I wouldn't ask a co-worker how much their shirt cost, so I would definitely never stop a stranger and ask how much they paid for their dog. I figure that's just plain old good manners on my part.