Dill didn't exactly "run" to Atticus--he was actually ratted out by Jem, who told his father to come into the bedroom where Dill was hiding--but Dill knew that he was better off dealing with Atticus than with his Aunt Rachel. He hid under Scout's bed because he wanted to be someplace where he felt loved and safe, and Jem and Scout were his closest friends. Dill knew that Aunt Rachel would call his parents, and he would probably be sent back to Meridian immediately.
Beneath its sweat-soaked dirt Dill's face went white... Atticus was in the doorway.
Scout reassured Dill, telling him that Atticus wouldn't "bother" him and not to be scared. Atticus made certain that the hungry Dill ate his fill before talking to Aunt Rachel, but Dill "shivered like a rabbit" when he heard his aunt's "Do-oo Je-sus" echo in the hall. But after enduring Rachel's scolding, Dill was allowed to spend the night in the Finch house, and they shared a hug before Aunt Rachel returned home.