A couple can marry legally (e.g. Prince Johan Friso and Mabel Wisse-Smit, who underwent a civil ceremony) but still not have their union dynastic (the Dutch Parliament withheld consent). A couple can marry canonically (Prince Augustus of Great Britain, sixth son of King George III, and Lady Augusta Murray underwent a Church of England ceremony), but not legally (the union was contracted in contravention to the 1772 Royal Marriages Act; hence, from the standpoint of the state, there was no marriage; the children were deemed bastards for the purpose of succession).
Observing historical patterns, it seems that LEGAL is more important than canonical: both the Earl of Saint Andrews and Prince Michael of Kent married their wives in only civil ceremonies. Yet, their unions are legal and dynastic (having received the consent of the British sovereign, in accordance with the RMA).
However, in recent times, even the requirement of legality of marriages has become murky: consider how Delphine Boel is now recognized as a legal daughter of King Albert II of the Belgians -- even being permitted to style herself with the title of Princess, with the qualification of Royal Highness.
As for consent: if I understand correctly, Spain does not require the consent of the sovereign, for a marriage to be dynastic. Rather, a union is dynastic by default: it is non-dynastic only if it is contracted against the explicit opposition of the sovereign and Parliament. According to this interpretation of the law, even if King Felipe VI and Queen Letizia eloped (while he was still Prince of the Asturias), his children would still be dynasts.
That there would be fine points of distinction on the legality and dynastic status of marriages is to be understood: each system works differently. Still, because the subject is relevant to the discussion of royalty, I thought it appropriate to address the question of legal marriage.
It seems that Belgium no longer creates a distinction between children born in and out of lawful wedlock, to qualify as royals ... Of course, Delphine and her children remain excluded from the line of succession to the throne ...
But then, titles and succession rights do not always correlate: the children born to the second marriage of King Leopold III (to Lilian Baels) have always been legitimate, styled with royal titles -- but never in line to the throne.
And in more recent times, the situation with the children of Prince Louis of Luxembourg have titles but no succession rights. Things are different in the UK, where a number of dynasts have succession rights but no titles (e.g. the descendants of Anne, Princess Royal).
710