All noble titles and prepositions are banned in the civil names of Austrians. Charles/Karl, the Archduke of Austria, is “just” ‘Karl Habsburg (-Lothringen)’ in Austria. I believe that the late Crown Prince Otto had a German passport.
Is it true, however, that in Germany one is allowed to style himself with the name of a formerly reigning or mediatized house, but without any princely or ducal title -- let alone the qualification of (Royal) Highness? Is the present head of the house of Wittelsbach styled, on his German passport, as "Franz von Bayern"? After all, he is legally a private citizen, since the dynasty got deposed a century ago.
In Germany titles were incorporated into the surname so mostly all royals have a surname which translates into the title that cadets of the family would have used. In some instances a head of a family has been able to change his surname from ‘Prinz von/zu...’ to ‘Fürst von/zu...’ etc but not always.
I am not sure if the Duke of Bavaria’s surname is ‘Herzog von Bayern’ or ‘Prinz von Bayern’, despite how he styles himself.
Note also that females (born into or wives) use the feminine version of titles in their own surnames.
The Prince of Prussia’s surname is ‘Prinz von Preußen’. Not sure what that pretended “Margrave of Meissen’s” surname is. I am not sure that late margraves of Meissen had ‘Markgraf von/zu Meißen’ as a surname; they may have had ‘Prinz von Sachsen (Herzog zu Sachsen)’ as a surname like other members of their family.
They aren’t illegal... they have some social recognition but it varies. The members of formerly reigning families may have some recognition in certain state occasions in their former territories but they are legally all private citizens as any other German.