It depends how it’s handled.
There are those online games where you are connecting to a server and you’re playing on the server. This means that someone closer to the server will have an advantage. This is because someone closer to the server will get information faster as to what is happening on the server.
Then there are the ones where you play on your own computer and your computer updates the server as to what you did and the server sends you what everyone else did. In this case everyone is actually playing their own littler version of the game and it doesn’t matter if anyone else is closer. If it’s an online First Person Shooter you can have cases where two players shot and killed each other because on their end they shot first.
Edit:
Example of the first one is World of Tanks. Whatever you do you’ll notice there’s a delay between you inputting something and your tank doing it.
Latest Answers