You do not need to turn off smoke or carbon monoxide detectors when fogging for bugs or fleas. In fact, I would never turn either off. However, if you suspect you have sensitive detectors, then you can cover them with glad wrap and remove it AS SOON AS the fogging is over.
These are life-saving devices and should be left on at all times. If you cover them to use a fogger, uncovering them after is your priority.