In engineering a dog is a tool that prevents movement or imparts movement by offering physical obstruction or engagement of some kind. It may hold another object in place by blocking it, clamping it, or otherwise obstructing its movement. Or it may couple various parts together so that they move in unison - the primary example of this being a flexible drive to mate two shafts in order to transmit torque.
ie, child sacrifice was one of the measures once taken to keep bridges from falling down
the passage through which liquid material is introduced into a mold. Eg, the bits holding the pieces in a plastic model kit.