From the man page, dd is a Unix tool to “copy a file, converting and formatting according to the operands”.

The trick to creating an ISO image is to “copy” the block device file itself, probably to a file.

Assuming the CDROM drive is attached to /dev/cdrom, the following command will create an ISO image of the disc in the drive to mycdrom.iso

$ sudo dd if=/dev/cdrom of=mycdrom.iso

In this example, the option if is for the input file, and of is for the output file.
To verify and probably to use the image at later times, simply mount the image with loop option. This example can also be used to create ISO image for DVDs as well