Pap, in The Adventures of Huckleberry Finn by Mark Twain, is almost the worst father one can imagine. He is an ignorant, abusive, racist alcoholic. However, even though Pap is an unsympathetic character and Huck a generally sympathetic protagonist, Pap did have a significant effect on the formation of Huck's personality.
First, lacking a stable and nurturing family life, Huck never really internalized many forms of social codes of his period. In some ways this was good. Rather than absorbing the racism of his surroundings, he lets his innate sympathy with Jim guide his actions rather than being guided by racial prejudice.
Second, Huck is only marginally literate. Rather than encouraging Huck to buckle down and get a good education, Pap, himself illiterate, after kidnapping Huck says:
"You've put on considerable many frills since I been away… You're educated, too, they say—can read and write. You think you're better'n your father, now, don't you, because he can't?"
Like his father, Huck is uncomfortable with the trappings of civilization, and dislikes the attempts of Widow Douglas and Miss Watson to ensure that he goes to school and that he learns some rudiments of good manners and personal hygiene.
Huck's rebellious nature and resistance to convention, which in many ways follow his father's character, lead to his ability to enjoy his adventures on the river and to survive them. Pap's father, though, also encourages Huck to enjoy smoking and swearing, and generally to live for the moment rather than plan for the future. While this might sound like fun while Huck is a teenager, this isn't really a path that leads to a happy adult life.
Although Huck is not (at this point in his life) an addict like his father, he still does have a somewhat similar character in craving excitement and adventure and lacking self-discipline.
Finally, Pap's casual cruelty helps form the good side of Huck's character. Having been beaten and starved himself, he has sympathy for Jim and other outsiders in his society.