I am pregnant. Are there any dangers to having a colonoscopy?

Remote. The only pregnancy-specific danger might be the choice of which anesthetic your gastroenterologist uses and at what stage in your pregnancy you get it. Generally speaking, the greatest danger to the fetus from exposure to outside chemicals occurs in the first trimester, so if the procedure can't be put off until after delivery, I would at least wait until 14-15 weeks.
Yes, best postpartum. Your maternal-fetal medicine specialist and your gastroenterologist should compare notes and determine if you really need to have a colonoscopy during pregnancy. If that cannot be delayed until postpartum, then the best time to have it is between 16 and 20 weeks. Risks associated include sepsis, anesthesia, preterm labor, dehydration, electrolyte imbalance. Best of luck!
Agree. With other answers however any procedure done while pregnant requires a discussion between the ob/gyn the surgeon and anesthesia to maximize safety and appropriate timing.