"This nut, he continued, with playful solemnity, -- while so many of its brethren have fallen and been trodden under foot, is still in possession of all the happiness that a hazel-nut can be supposed capable of."


Hazel Tree
Creative Commons Attribution Share AlikeHazel Tree - Credit: Nikanos

The hazelnut, from the hazel tree, is a particularly choice nut for confections and, like most nuts, is made into a fine butter and oil. 

Interesting traditions from folklore and myth associate the use of hazelnut limbs with water divination, and the tree itself as protective from thunder and lightning storms.  The nuts are associated with fecundity and forecasting marital longevity.

When Captain Wentworth jokingly compares Miss Musgrove to a hazelnut, he is flattering her strength of will, and the reading audience most likely would have known of its associations. As the narrative progresses this is shown to be ironic.