Opal and Winn-Dixie are alike because they are both sort of "ugly ducklings" who feel like they have been abandoned and need someone to care about them.
When Opal meets Winn-Dixie, she is new in town. She and her dad have just moved to Naomi, Florida. She and her dad have been abandoned by her mom and she clearly feels very alone and vulnerable because of that. Winn-Dixie is (allowing for the fact that he's a dog) just the same way. He is a stray who has gotten himself into trouble in the store. Opal, of course, takes him home with her.
As the book goes on, we see how the two of them are similar. To see this, look at the end of Chapter 4 and the very start of Chapter 5. We see the author juxtapose the emotions of the two characters very nicely. Chapter 4 ends with Opal thinking about her mother and how, if her mother ever came back, she would
grab her and hold on to her tight and not let her get away from me again.
The very next line, the first of Chapter 5 is
Winn-Dixie couldn't stand to be left alone; we found that out real quick.
Just in those two lines, the similarity between these two is made clear. They both have been abandoned and neither of them wants to be left alone if they can help it.
It is because they are so similar and need each other so much that they come to be so important to one another as the book goes on.