It is never appropriate to touch the belly of a pregnant woman without permission. Would you want relatives or strangers reaching out and patting your belly? Our stomachs are private areas. Just because the pregnant belly protrudes a little more than most, does not make it common ground. Please respect the personal space of a pregnant woman.
Many pregnant women have asked me how to handle the awkwardness of someone reaching out to touch their larger than normal bellies. One easy way is to reach your hand out to stop them and say, “I’m sorry, this baby is fussy and likes his/her/its privacy.”
One of my clients asked if she could reach back and pat the belly of the obtrusive person. Sorry, this might be effective, but two wrongs do not make a right.