Hex codes are reused all the time. In the US for instance the hex/code registration is tied so if the registration is re-allocated the hex code is therefore reused as well, there are plenty of registration that have been used 4/5/6 times and the hex code is always the same.
In the UK the hex is tied to the frame therefore if the aircraft changes registration the hex code still stays the same as an example AT43 G-HUET with Aurigeny is now G-LMRD with Loganair using the same hex as it had as G-HUET.
Some countries re-use hex codes with different frames/registrations .
The uniqueness comes with only one aircraft being allocated with the a hex code at the same time and in an ideal world that should be it but the world is not ideal. You can see every day miscodes which can see the same code being used by 2/3 or more aircraft at the same time. As an example aircraft use a test registration with its associated hex code for test flying bu its manufacturer and when it is sold abroad the transponder is not changed and you can have a number of aircraft flying around in different parts of the world showing the same code
Alan