During manufacturing, the AVR chips get codes which can be read. They are called "signature bytes" and can be read with "boot_signature_byte_get()" from boot.h.
For the ATmega32U4 (Arduino Leonardo), there is a unique number that can be used to identify the Arduino board. However, that is not guaranteed for the ATmega328P.
The usual way is to store a number in EEPROM. That could go wrong if the EEPROM is cleared.
The best way is to use a DS18B20 temperature sensor. They all have a guaranteed unique serial number. If you buy a DS18B20 from AliExpress/Ebay/Amazon, then you have a counterfeit temperature sensor. No one knows how unique those counterfeit numbers are
A common way in the past is to use dip-switches. That is still a good option.
My project is similar to the idea of the printer. It accepts only original toners or cartridges (my project is not a printer but I need this identification concept). So I assume that the toner has a chip that has a special identification.
Maybe this can help in having a better understanding of my question.