I think the following points of comparison are significant:
- Both are very superstitious - which connects them in some ways, provides conflict at other times.
- Both are running away and hiding in the process - this is the foundation for the entire novel. The reason they need and rely on one another is due to this commonality.
- Knowledge and education - while Huck has attempted formal schooling and Jim hasn't - both have a very mixed up view of the things they discuss on the river. Both have obtained most of their knowledge from experience - rather than books (or someone else teaching them), which makes for some humorous stories, gullibility, but also a keen sense of right and wrong based on intuition.
- Both, at the core of themselves, are kind hearted and mostly honest (with the important things), and this makes them genuine in their friendship with each other.
The significant differences are a little more obvious:
- Their ages - this provides a lot of opportunities for situational irony because Huck is just a child and Jim is a full grown man, but at times, the role reversal between the two is laughable.
- The fact that Jim is a black slave and Huck is white and free (and subsequently wealthy though not by birth) - seems like it should create a big opportunity for conflict. Again, ironically, the two not only get along - but manage to even disagree civilly when it comes to racial matters. This is one obvious difference between them on the outside that doesn't affect them as much as it does others, on the outside.