Fingernail biting is genetic. Thumbsucking is genetic. He can't help it. Don't punish him. Change the behavior but he really can't help it any more than he can help the color of his eyes.
When my son was 2 or 3 years old, he bit his fingernails. But one day he stopped without any prompts. He is now 6 years old. Now, my 2 year old daughter is a fingernail biter. No stressful events surrounded their behaviors. So, I'm hoping my daughter too will stop on her own.
She needs another way to soothe hersef. Can you help her find another way....a blankie, a silky touchie thing, yoga, rocking...anything?
The behavior likely serves a tension-reduction purpose, as most of these behaviors do. It does not necessarily reveal an anxiety disorder, though with the family history this will need to be watched over time. At your daughter's young age, there's really not any specialized intervention that would be warranted. Try to notice the times when she is more apt to bite her nails; this may help you identify situations which might be more stressful for her and you can then make efforst to have her occupy her hands with other objects. If the biting is more than minor, you might try using the readily available preparations that taste bad and discourage children from biting their fingers or nails.