Wow. The above answer is completely wrong. CD/DVD Diagnostic and CD/DVD Inspector both capture RID when it is available, but for the most part it is not.
Yes, there is a standard for RID and it is mandatory for stand-alone CD audio recorders. It has been completely implemented in all of these devices. However, most people are using computer components, not stand-alone stereo components and RID implementation is very, very spotty.
In general you have maybe a 10% chance of finding RID on a CD disc. There is no implementation of RID on DVDs, although there are some indications that a RID-like scheme was proposed as an optional part of DVD recorders, but nobody has done it to my knowledge.
The format of the RID data is completely documented in the standards documents. You just have to dig it out. But for the most part, you aren't going to see it. Look at discs written by older NEC drives (2003-2004) for an example.
Other information, such as the real date the disc was written and the application used to write the disc are much more likely to be present. Not quite as good as a serial number, but it is there and you can get it. CD/DVD Inspector makes it very simple to collect this information.