I've been married for 7 years now and I'm going to turn 30 in November. This is something that happens to me on an almost constant basis. I don't want to make fun of anyone who has said these things to me or make them feel bad. My intention is to let people know that these comments are more harmful than not. I always panic in the moment and don't know how to respond, typically because I would be fine with sharing the truth with the person talking to me, but not with everyone else who is listening and staring at me. My go-to response is to pretend that I don't want to have a baby, or I'm not ready, or I hate children, or something along those lines. Well, that's a lie. I'm just not comfortable sharing the intimate details of my life in a public setting.
If a couple doesn't have children, there are really only 5 possibilities.
1) They don't want children. They've decided this already (or maybe they're still on the fence) but they're likely to be pretty sensitive about it since it's such a hot topic. You bugging them about it will likely make them defensive and angry, and will probably damage your relationship with them.
2) They want children, just not yet. Maybe they aren't emotionally ready. Maybe they need to get their finances in better shape. Maybe they have physical issues or medical problems to sort out. Maybe they're dealing with problems in their marriage they need to resolve.
3) One of them wants children and the other doesn't, or does but isn't ready for children yet. Again, this is like ripping a big scab off a sore in their relationship. Don't do it. The one who wants children/is ready for children may be tempted to tattle on the other person and let them take the blame. This isn't good for their relationship, and you just made it worse.
4) They're infertile. Maybe they've been trying for a long time and can't get pregnant. Maybe they've had a series of miscarriages. Maybe they're in the middle of expensive and difficult treatments. In any case, telling them to have a baby is like a kick in the stomach.
5) They're already pregnant but don't want to tell anyone yet (or don't want to tell you before they tell their parents). Maybe they aren't pregnant quite yet, but they just started trying. Some people are comfortable discussing this and some aren't.
In most cases, with most people, it's ok to politely ASK about their plans for having children. This really depends on your relationship with the person. It's possible they just don't want to discuss it with you, so give them an out and let them know that's ok too. Above all, only ask IN PRIVATE. It's very possible that they're comfortable discussing it with you but not with someone else in the room, leading to an awkward silence or uncomfortable lie.