Every government is going to have their own regulations for this sort of thing.
For the US, the law states:
Unless exempted under § 206.7, no drug product in solid oral dosage form may be introduced ...
A few answers compiled from the comments, which are no own answers yet:
The regulations the require pill imprinting
The Evolution of Imprint Identification
Pill Identifier by drugs.com