This is a rare problem, bt we do see it occasionally. he dog may have a persistent nail bed infection, but it is more likely a disorder called systemic lupoid onychodystrophy - which is an immune mediated disorder that nrmaly affects the nails on all four feet and is very painful, making the dog pretty miserable.
It definitely requires veterinary treatment with antibiotics - I usually use oxytetracycline - and painkillers. In extreme circumstances some vets actualy remove the nails, but this is quite drastic.
I have emclosed a link which explains the problem in a little more detail:
I hope this helps,