If you want or need to approach a stranger for a conversation, first always start by greeting them, and then state your intentions and/or what you wish to talk about.
Especially in online spaces, in this day and age online spaces are so flooded with spam bots, most people assume anyone who just messages them with "Hi" or "Hello" is a spam bot, so most people are prone to ignoring or even blocking those who just message "hi" or "hello" without anything else.
If you would like your message to actually lead anywhere, it's still important to begin with some sort of greeting such as hi or hello, but give the other party more to work with. State your intentions, or what you'd like to talk to them about (I saw in your post x and I wanted to ___), otherwise many people may assume you're a spam bot and either ignore you or block you.
Likewise in real life scenarios, in many places and cultures if you just approach a stranger and say "hi" or "hello" and stand there looking at them and expecting a conversation to follow, many people will find this unnerving, invasive, and in many instances downright creepy.
This is because when you're a total stranger it's harder to know if you have good intentions or not, and many people naturally feel more guarded with a stranger. Therefor, if you really want to strike up a conversation with a stranger, you need to lead with something besides "hi" or "hello", if nothing else to signal good intentions. Something such as "Hello, I saw your t-shirt and just wanted to say I really like that band too!" or "Hi, so sorry to bother you, but I noticed the pins on your bag and that's my favorite show!".
It's not just about signaling that you're not a spam bot, or signaling good intentions on your end, it's also not considerate to initiate a conversation but expect the other party to do all the work with finding something to talk about. It's inconsiderate to start something, then throw all of the work onto someone else to make it happen or keep it going. You started the conversation, so it's your responsibility to give them something to talk to you about.