This is a great question.
From one perspective, these characters come from two different worlds. Tom Robinson is a black man who is unjustly accused of a crime that he did not commit. Boo Radley is a white recluse that lives at home.
From another perspective, they are very much alike.
First, Both have been treated poorly in life. Tom is wrongly accused, and eventually he is shot in prison. Boo grew up in an oppressive family. Miss Maudie says that Boo's dad was a foot-washing baptist, who thought all pleasure was wrong. Here is a quote:
“Foot-washers believe anything that’s pleasure is a sin. Did you know some of ‘em came out of the woods one Saturday and passed by this place and told me me and my flowers were going to hell?”
Second, Boo and Tom are fundamentally good people. From the beginning of the book, Boo only cared for the children. He left them gifts, put a blanket around Scout when it was cold, and protected them when Bob Ewell attacked. Likewise, Tom only did good things for the Mayella. Whenever Mayella needed chores done, he did them without charge.
This is why Tom and Boo are mockingbirds. Scout comes to this point in a flash of insight, when she says that Boo is a mockingbird.
Atticus disengaged himself and looked at me. “What do you mean?” “Well, it’d be sort of like shootin‘ a mockingbird, wouldn’t it?”