NPCs/mobs (most commonly villagers) also glitch through solid blocks laterally/horizontally. This can sometimes happen even when not being pushed by other NPCs/mobs.
They treat the solid block as though it wasn't even there - maybe a space they will not preferably go, but if pushed or influenced will enter it unrestricted. If pushed enough (or even if just trying to escape from an enclosure), they will eventually walk straight through the obstruction, before teleporting back when about 10-15 blocks away or when attacked.
This happens with any solid block including cobblestone walls and fences, and the most common exit point is through a corner, although they can leave through a flat/straight section of the obstruction, whatever it may be.
This often happens to me too (using 1.4.2), though mainly with humanoid NPCs/mobs climbing up stairs. They enter the ground and walk around half-submerged, then randomly pop up again later. If there is a block or surface alongside the stairs with and empty space above it, they attempt to walk onto it, but if they are still slightly below it, they half enter the block, and so are submerged. This occurs most often with villagers.
This bug does not appear to be present in Minecraft Xbox 360 Edition.