I don't know about other products, but the idea has merit for medicine. The way this is different form a serial number is that each bottle would have a
unique number, just like when you buy software (as someone already pointed out), but additionally you can not see the entirety of the unique number from the outside. Although, as someone else already pointed out, counterfeits need not use a genuine serial number. Might be enough to just
look like a genuine number. HOWEVER, when it comes to counterfeit drugs, if there is a database you can confirm online or via phone, you will potentially be saving a life by taking a moment to verify the serial number. With the system Uday describes, you are guaranteed that number is in fact unique, as part of the number is hidden inside the package. (So even if the counterfeiter goes to the lengths of mimicking this design and puts part of the serial number in the inside, there is little chance that it will match a real number, which will be verified online/phone.) Counterfeit drugs are problem in the US and UK, but they are a much much bigger problem in other countries, where it may be harder to find and capture the perpetrator. Not sure if someone already shared
the FDA page on the subject.
EDIT: I see this kinda of thing as being used more by the doctor/clinic/pharmacy to do verification rather than the individual, but both would be good.