Buck has gone through a horrible series of events by the time he ends up with Thornton. He has had masters that he could trust, and he has had ones that were horrible beyond belief. When Thornton arrived on the scene and saved Buck from being beaten to death by the woman, her husband, and her brother, Buck realizes that he has "landed on his feet," so to speak. When Buck licks Thornton's hand, he is letting him know (and us, the readers) that he trusts him and believes in him, and even that he will lay his life down to defend him.
Check the links below for more information on these characters! Good luck!