Yes and no. Insect foggers or bug bombs as some people call them serve the purpose of releasing a "fog" of contact killing pesticide into the air with the hopes that it will contact bugs in areas that you couldn't get to while just spraying.
Foggers, while initially effective, often times push roaches into deeper hiding where the fog will not reach, causing roaches to re-infest an area a few weeks down the line. They usually won't affect insect eggs either, making the problem tough to get rid of by just using the bug bombs.
Insect foggers are also dangerous is misused. They can be extremely flammable and explosive and if not set off correctly it will combust.
The best way to use a fogger is as a tool in an overall program. Professionals will use a fogger to flush out the roaches and get them running. Before they set the bug bomb off they will put down a residual product around the perimeter and in cracks and crevices. Then the roaches or insect will run across the residual product and die.
One good application for a fogger is if you are dealing with large numbers of flying insects. A good fog can knock that problem down fairly quickly.