The connection can be found in the fact that in both instances the two events are connected by urgency and necessity. Both Atticus' shooting of the mad dog and his representation of Tom Robinson are situations he'd rather not be in...... he doesn't want to shoot the dog, and he doesn't want to represent Tom, but he does........ because he's the only one there to do it.
Judge Taylor pushed the defense case on him because he could handle it; he was the right man for the job;
"... John Taylor pointed at me and said, 'You're it.' "
It was the same sort of thing with the dog...... Atticus was there; he was an ace shot, and even if his children didn't know it....... the Sheriff did. Thus, he "... almost threw the rifle at Atticus..."