Your question is a good one.
It can scientifically only be answered through statistics.
The important figures are:
1) Number of (and length in bits) of errors per area or span of time (seconds)
2) The effectivity off the Error Detection Circuitry and Error Correction Circuitry in fixing the aforementioned problems
3) 1+2= the amount of unfixable errors errors per area/timeslot
Considering these, I think both can be good.
However, the hard disk has tighter tolerances as it's a known unit of heads/platters.
CD/DVD is a combination of an unknown media and an unknown writer, hence the variance in quality is much larger.
Due to this, I'd say that yes, for writing quality IMMEDIATELY after the writing, hard disks have better writing quality (statistically). Now assuming properly functioning and not broken devices (both hd and discs and burners).
However, as long as one starts to measure the readability of this data after several days, weeks, years, etc... then all bets are off.