It depends on the game. There is no such thing as "the" online game. Every game has its own network protocol with its own lag mitigation techniques.
However, properly developed games do not allow the client to decide whether or not they got hit or hit something. Otherwise it would be too easy to cheat. Usually the server decides which shots hit, how much damage they inflict and when a player is fragged. Usually... as said, different developers do things differently. I have seen games which do hit detection client-sided. Such games can usually be recognized by the huge amount of cheaters running around invulnerable and/or hitting things they can not actually hit. This can be the result of less experienced teams which aren't aware of what cheat developers are capable of. Other cases are games which were first developed with only single-player in mind and then very late in development someone decided that every game needs a multiplayer mode, so one was added in a very rushed manner on top of a software architecture which was never designed for that.
But even properly-constructed multiplayer games with authoritative servers are not immune to ping trickery.
It gets interesting when it you look at lag compensation. Many games try to compensate for the latency of players to make the game seem more fluent even when the connection is bad. So the server might take the ping into account when calculating hits. When a player has a very high ping (let's say 200ms) the server might calculate hits not based on the current game situation but on how the game was 200ms ago. This makes the game appear more fair for the high-pinger.
But this does open potential for cheating when the client can trick the server into thinking that it has a different ping than it actually has. This can be achieved by intentionally delaying packets, faking timestamps on certain packets, anticipating when ping packets arrive and sending one earlier etc.
Whether a higher or a lower ping is better depends on the game and the circumstances. It's usually not much the player can gain from this, but it is something you need to keep in mind when you design a network protocol for a multiplayer game.