It is customary to wait until anyone who used the title in any form as died before recreating unless that person has been risen to a higher level and then only with their consent.
As always, if you (or anybody else) believe I have gotten any facts wrong, you are of course very welcome to say so.
I have updated this post with a third example in order to also encompass the
former users of peerages' designations. In the preceding version of this post (which was written and posted in response to this specific claim being posted earlier this week and twice earlier this year), I mistakenly stated "or formerly were named" although I only meant to include those who were still using the territorial designation at the time of the potential recreation.
There is no such custom, because the very particular situation in which
1) A royal peerage reverts to the crown because the peer lacks a male heir, not because the peer becomes king,
2) the peer is survived by family members who are or formerly were named with the territorial designation of the peerage, and
3) at least one of these family members is still living when a subsequent royal dukedom is created.
has only happened for
three peerages in the history of the British royal family: Cumberland, Edinburgh, and Connaught.
In
two out of three of these instances when the dukedom was available for recreation during the lifetime of a person who used or formerly used its territorial designation, the dukedom was in fact recreated (Cumberland and Edinburgh). The only exception was Connaught - and that would have been politically difficult in any event, as it was located in Ireland.
The dukedom of Cumberland reverted to the crown in 1790. The next creations of royal dukedoms happened in 1799 when Princes Edward and Ernest Augustus were made dukes. The widowed Duchess of Cumberland was alive at that time, but Prince Ernest Augustus was created Duke of Cumberland.
The dukedom of Edinburgh reverted to the crown in 1900. By then there were no family members named "of Edinburgh", as the duke had become the ruling Duke of Saxe-Coburg and Gotha in 1893 and he and his family had been named by their German titles ever since. However, his daughter Infanta Beatriz of Spain (born Princess Beatrice of Edinburgh) was still living when the dukedom of Edinburgh was recreated for Philip in 1947.
The dukedom of Connaught reverted to the crown in 1943. The remaining family members who were or had been "of Connaught" were Princess Arthur of Connaught and Lady Patricia Ramsay (who had dropped her title when she married). The only subsequent creation of a royal dukedom to happen during either of their lifetimes was for Philip in 1947. Of course, he was created Duke of Edinburgh and not Duke of Connaught, but in view of the Ireland situation, Connaught probably would not have been under consideration even if Princess Arthur and Lady Patricia had both passed away before 1947.