It's dramatic now,

What If they register their marriage before the grandfather register his daughter under family name. Will they be forced to divorce afterwards?

IANAL, but I believe in that situation, the marriage would be annulled.