Yes, hamlet does mean “a little ham,” but the ham therein has nothing to do with any member of the Sus, or hog, family.
It had originally, that is, to do with members of Homo sapiens, those who, in the times of Alfred the Great, lived in a small collection of cottages, a small village, then called a ham.
The term survives in such place names as Shoreham, East Ham, Oakham, and others.