Let us consider first a monochromatic ray. It is refracted both when it enters and when it exits from the prism. The refraction must be seen with respect to the normal (perpendicular) to the interface: when the ray enters into the glass it bends towards the normal, when it exits it bends in the opposite direction. This difference can be easily explained considering that light can make the same path in both directions!
It is worth noting that the drawings provided with the question are both wrong. I assume that the gray area is the glass and I follow one of the colors (say, the blue). The first refraction (from air to glass) is (qualitatively) correct: the ray bends towards the normal. But the second (from glass to air) is wrong, as it is still towards the normal.
So, look here for the correct scheme. You see that, the two refractions take place on surfaces with different normals, thus the outcoming ray is tilted with respect to the original incoming one. If you take a slab (glass with two parallel surfaces) the situation is qualitatively similar; however, the normal of the two surfaces is the same, hence the outcoming beam will take the same direction of the original (incoming) beam,
see this nice picture.
A similar thing happens when you put two prisms as shown in your picture on the left (not so wrong...). After crossing the two prisms, the rays take the same angle of the incoming ray. This can be explained noticing that the surfaces that are crossed are four, divided in two couples having the same normals (the upper surface of the upper prism and the lower surface of the lower prism has the same normal, the lower surface of the upper prism and the upper surface of the lower prism has the same normal) although the normals of the two couples are different among them.
Now, coming to the question about dispersion. Basically, what changes among colors is the amount of refraction. If you have a slab, or two prisms coupled as in your figure, all the outgoing rays will have the same direction of the incoming ray. But the various colors will have more or less lateral displacement. The slab or the prism system do not show much difference.
Also in the case of the slab, the colors are separated (maybe only slightly, if the slab is thin), but the directions are the same.
Instead, we know that a prism bends the outgoing ray. And will bend more some color with respect to another, so we will have a beam which spreads, with red rays going to a different direction with respect to blue rays.