I do not recommend it. Optical drives need to be positioned flat or on the side, and there would no way to mount the notebook drive into the desktop.
For under $20 you can have a Liteon DVDRW made for a desktop.
http://www.amazon.com/Lite-On-Internal-Drive-Optical-IHAS124-14/dp/B00ERJXTE4/ref=dp_ob_title_hi
If you want something even less expensive, and you really do not want an optical drive in the desktop as you will never use it, you can get a cheapie for external use via USB.
http://www.amazon.com/External-CD-RW-Combo-Drive-Writer/dp/B002782LTG/ref=sr_1_16?s=electronics&ie=UTF8&qid=1421897836&sr=1-16&keywords=optical+drive