Legally, yes.

However, a disk cannot determine when it is getting copied, so NO, that is not possible.

I have seen floppies that you are supposed to install from that have made changes to themselves once you install from them, but a CD is ROM, so it cannot tell or make changes to itself.