I do it when I’m asked, and sometimes even ask people to say hi/send a hug if I’m with someone and they’re talking to a mutual friend or family member on the phone.
Sometimes you just want to tell them “hey, you matter to me :)” even if we’re both busy or there is no need to catch up on what’s been going on in our lives (and a quick hi is enough).
It honestly depends on the people and the situation.
Say I know my mom likes A and isn't crazy about B. I'm hanging around with both of them and both tell me to say "hi" to mom. I might not say B sent he a greeting because she doesn't like them, OR I might pass it along so she'll start to like them.
Sure I both request it and do it for others. My partner and I have many mutual friends that we'll see independently so a not-uncommon interaction goes like "I'm getting lunch with the Blahblahs today." "Oh how fun, I have to work through lunch today. Enjoy, and please tell the Blahblahs hi and that we're looking forward to seeing the concert with them on Friday." We're all very busy but most people like to hear that a friend is randomly thinking well of them.
I did until mobile phones became the norm, now I ask if they need her number to call. It made sense before phones were everywhere and you didn't make it to see everyone, but send a text yourself. My name isn't SMS.
Most people already have the number, the point I make in asking is to show them that I don't need to be their messenger. You can call my mother/father/grandmother yourself. If they're asking about my wife/kids, I'll just say "Sure" and then forget because I'm apparently a goldfish.
Most people who say "Tell them hi" are my parent's and grandparent's friends anyway. I don't give out a true friend's number, I agree that is not good.