To limit the movement of a body by impacting another.

Hi, is there a way to set it so that if I drag a body, it will hit another one? They can't overlap.