I have a background mostly in Krav Maga and ICS (Israeli Combat System), and one of the techniques taught for disarming a gun, involves grabbing the barrel of the gun and pushing it to the side before taking it away. They tell you that the gun may end up going off at this point, but since it is no longer pointed at you when it does, this is not a problem. What I am wondering is what kind of damage can be done to your hand through either burns or something happening when the slide of the gun slides back.
Assuming your not in the tragectory of the bullet when it's fired, you can obtain the following injuries:
The first danger, excluding the round, will be the slide. There is considerable amount of force exerted by the gas release and slide recoil. If you finger is trapped inside the ejection opening in the slide it can be cut, broken or suffer an avulsion (separation). Secondly as the slide moves you can get a sliced and/or a friction burn. The barrel of the gun will also be very hot, normally encased inside the slide in most semi-automatic you could come into contact with it and get a thermal burn from it.
If the gun is being fired when you grab it your hand and forearm will be in close contact to the the ignited gun powder and super-heated gases. You can suffer thermal injuries in this case.
Personally I try and attempt wrist control when disarming a gun and get in close. If it goes off and damages my hand, possibly severely, I may not put up much of a fight at that point. You hand position in the gun will be very important to minimize injury, as user249228 showed in his YouTube video link. But you have to understand body and hand positioning at that point, in that video he has his hand clamped on top of the rear sight and the slide moves toward him. If it's someone else holding the gun, you will have an outside grip to get that position and the slide will be moving away from you, both are contention with normal body mechanics.
I've personally sliced my finger open from a kick before. If your grip isn't that great, you'll get cut, but a minor laceration is nothing compared to a gunshot would. Also, many external hammer pistols will not go off if the slide is pushed back a little it.
On a side note, if you manage to grab the cylinder of a 6-shooter that hasn't been cocked (hammer still forward as is common in many double action revolvers), then it will not fire.
The technique you mentioned saved the life of one of my buddies who is a sheriff, so it does work... sometimes. We used to train this with airsoft guns and you do get plinked... some people more than others
Therefore, someone wants my wallet, I'll give him that over trying to disarm him. Someone wants to rape my wife, time to try a disarm.