If it's stated in the game he has the power to do it, he has the power to do it.
Why wouldn't Grima use the full force of his attacks
...through non-canon hacking.
Still,
I'll use the first hit, then. By pausing the video, we can see that the damage indicator on the right fades away sooner than the one on the left:
A frame of a video on YouTube is 1/30 of a second. Some videos are in 60fps, but a quick look at the quality shows us that this one is not. Anyway, this obviously takes more than a frame, but I'll work with one frame for now. So, this takes 1/30 of a second, or .03333..... (infinite threes) seconds. I calculated earlier that it takes less than .01 seconds for Sonic to travel ten meters. So Sonic will be at least ten meters away before counter activates, and thus out of range.
That's due to the game processing slowly. Either way he would still take the damage, you have to be in that range when you attack, not after the attack.
I fail to see how punching a wall and not being injured (which humans can do IRL) makes you invincible.
Because if they punch a wall and take no damage, according to you that means they can take the force of their own attacks. While this is true IRL, laws of physics don't apply in video games. You can sit there all day and have Mario punch that wall, and will take no damage, so according to you that means he is invincible.
He can boost after hitting a wall.
But not after getting hit by an attack.
In that video Sonic clearly wasn't traveling at full speed, which is 10 times faster than the speed of light if I remember correctly. If he was traveling at full speed, he would have went all the way around the world about 80 times in that level.