For DVD-R family (but not +R apparently)
An identification for the drive which was used for burning a DVD is defined in ISO/IEC 23912 standard for recordable DVD media.
This Unique ID Field is written in a specified area previous to the lead-in. The size of the Unique ID Field is 32 bytes for the manufacturer, 16 bytes for the serial number and 16 bytes for the model name.
That's cited to "Ecma International: 80 mm (1,46 Gbytes per side) and 120 mm (4,70 Gbytes per side) DVD Recordable Disk (DVD-R). In: Standard (2004), S. 7374" The +R has a different standard, by the way. It's not clear at all from the paper if the latter standard just doesn't account for that info at all, or what.
Wikipedia however says
Another distinction in comparison to DVD-R/RW/R DL is that the recorder information (optical drive model) is not written automatically to DVD+ discs by the drive. Nero DiscSpeed allows proprietarily adding such information for later retrieval.
(Presumably the latter software uses some proprietary format to add the info... somewhere.)
With a Plextor drive you can read that (for DVD-R/DVD-RW and the DL variants thereof, at least, but apparently not for the '+' variants, ie. not for DVD+R etc.) using the PxScan software [on Windows].
Also this is ancient software that may be hard to run on something other than XP, due to ASPI requirement, although the software's author reports running it ok on Vista via frogASPI.
Other software that does disc/burn quality check using chipset-specific commands (thus non-standard) may be able to read that RID info as well, because they rely on reading raw data, but I don't recall other software right now that advertised the (RID read) feature.
The Windows version of QPxTool also supports this, apparently with the same limitations drive and disc-wise.
I suspect the Linux version of QPxTool has the same features/limitations, but I cannot check quickly. From a screenshot on the site, one cannot read the writing-drive serial/mfg from DVD+R discs, at least from Linux (even on a Plextor drive), using that tool either.
As for CDs... only a very obscure piece of software, PLScsi, can apparently read that (and none of the above tools that can read the DVD id can do it for CDs.) And even that PLScsi only works for Plextor drives, but apparently all writers tested in that paper violate the CD standard and write a bogus serial number (to CDs), although the drive type was sometimes correct (but it seems to more often indicate the chipset).
PLScsi found the manufacturer’s code, the device type and the serial number. Often the serial number is
012345(hex). So only manufacturer and type are clearly ascertainable.
The table 2 shows the test results.
Additionally, in this study other programs like Subcode Analyzer, RID code, Nero Disk-Info, PxScan,
CD/DVD Diagnostic, QPxTool, X-Ways, FTK and Encase were tested for the identification of the used burning
hardware of a CD, but without results.
And an LG drive couldn't read any info at all even with PLScsi.
Some standalone hardware recorders, like TASCAM CD-RW402 also claim they can display the RID (for "drive 2" only--i.e. the [re]writable drive; "drive 1" is CD-ROM in that machine.)
The RID (recorder identification data), if present,
can be shown for discs playing back on drive 2. Press the ERASE key while playback is taking place to display this data.
How well that works in practice is anybody's guess. But that manual usefully tells us how this info is presented/stored for CD's (it's more abbreviated than for DVDs):
The first three digits of the RID are assigned as the Manufacturer Code, the next four digits as the Type Code, and the last five digits as the Recorder Unique Number. TEAC’s Manufacturer Code is “TCJ”.
The DVD writer serial numbers however are typically much longer than that (as reported when they write DVD-R). So I guess that's why they [usually] punt and write a fictitious serial number in CD writing mode.