Huckleberry Finn has a complex view of slavery as presented in this novel. While he tacitly accepts society's right to set its own rules of behavior (which, for Huck, are both legal and moral rules), Huck ultimately does not feel that he is beholden to all of these rules.
This is Huck's central conflict - to balance his natural moral sense with his moral instruction. The things he has been taught as right and wrong do not always seem right or wrong in the moment.
We can see this in Huck's misguided loyalty to the King and the Duke. Huck does not actively look for opportunities to escape these characters because he does not want to betray them until they have already betrayed him.
Regarding slavery, Huck is equally subdued by his perceptions of society's codes of conduct. However, even early on he is prepared to be condemned by society if it means doing what seems right to him.
We see this when Huck finds Jim on the island in Missouri and Jim tells Huck of his escape. Jim asks Huck to promise not to tell on him or turn him in. Huck responds:
“Well, I did. I said I wouldn't, and I'll stick to it. Honest injun, I will. People would call me a low-down Abolitionist and despise me for keeping mum—but that don't make no difference. I ain't a-going to tell, and I ain't a-going back there, anyways. So, now, le's know all about it.”
This attitude can be seen in light of Huck's view of slavery and of his position regarding socially defined morality more generally. Huck understands the rules, but does not agree with them. He knows what he should feel is right or wrong, but he cannot see the reason for feeling that way.
The ultimate commentary on slavery offered by Huck's character comes in his decision to free Jim rather than helping to return him to Miss Watson. Huck places Jim's friendship and humanity above his legal status.
Rather than betray Jim, though, Huck decides, "All right, then, I'll go to hell." Huck learns to decide for himself in various situations the right thing to do.
Though Huck remains conflicted as to whether or not he will be condemned for his behavior, he feels that helping him is preferable to abandoning him. He never changes his mind about society's right to set its own rules, but he comes to a firm decision to follow his own mind and his own natural moral sense.