Interactions with strangers are not necessarily dangerous. Many people are strangers that we don't know, but lots of people are very kind and friendly people and we can usually talk to them and be friendly.
However if for any reason you feel uncomfortable, you should not speak to that person. Move to a place where you feel safe. Remember, if a stranger or a person you know asks you to go somewhere with them unexpectedly, you should always say no.
Many computer games involve online chatting with both friends and strangers. People you meet this way might not feel like strangers, but you must never agree to meet them or go anywhere with them in real life. Never give them any of your details.