Grounding from plug to Box
Looking at the second picture in the question, makes the grounding path to the box evident.
While the yoke of the device may not be a great (or approved) grounding path (unless it's a self grounding device), it may well serve as a grounding path in an emergency. Which when it comes down to it, is the purpose of the equipment grounding conductor.
Grounding from box to earth
In some situations conductors leading to the box may be either in metallic conduit, or cable assemblies sheathed in a metallic covering. In some cases, these metallic pathways can provide and adequate grounding path. In these situations, the grounding ring on the adapter can indeed provide and adequate grounding path.
Unfortunately, there are a lot of situations where nonmetallic cable is used to supply nongrounding type receptacles. In these cases, the grounding ring will not provide a path to ground.
Without an adequate path to ground from the box, this setup could actually be more dangerous.
Short to ground inside the box
If for some reason the ungrounded (hot) conductor comes into contact with the metallic box, the box can become energized. If this adapter is connected, the grounding conductor of the plugged in device can also be energized. In this case, if the grounding conductor is attached to a metallic outer covering of the plugged in device. The outer covering can be energized, and becomes a potential shock/electrocution hazard.
Inadequate grounding path
If the box is supplied using older armored cable, the cable sheathing may actually be a high resistance path to ground. This could lead to heating of the cable sheath, in some cases to the point of ignition of surrounding building materials. Modern armored cables provide a low resistance path to ground, and are often approved to be used as a grounding means. So if newer cable is used, this may not be a problem.
Broken grounding path
The box containing the receptacle may be supplied using modern cabling, and a grounding path may be present. However, the modern cabling may be connected to older cabling that does not provide a grounding path. In this case, fault current will follow the grounding path back to the junction between old and new cabling, and lead to potential hazards at that location.
In some cases these devices work as intended, and provide an adequate path to ground. In other cases they do not, and can potentially introduce other hazards. Though we must keep in mind, the equipment grounding conductor is a safety device. Under normal operating conditions, this path will never have current flowing through it. Because of this, the dangers from a device like this are limited.