To ditch is to abandon someone as the group moves on. Say 5 or 6 people are hanging out at the mall. They don't much like Eric. So when Eric goes to the bathroom, they all decide to leave and move on to their next destination. They have left Eric behind. They have ditched him.
In contrast, to dodge Eric would be to see him walking in the mall and to move where he could not see you, to thus avoid contact with him altogether.