Mike in Brampton Ontario offers the suggestion that when electrical boxes are too far inside the wall for the electrical outlet or switch to sit firmly on the box, you could add washers to the mounting screws. This will shim the outlet forward and make it possible to screw it down firmly when it is flush with the wall. For even another technique, click HERE.
This works well and safely for boxes that are still in contact with the drywall so that, while the drywall may not be flush with the front of the box, there isn?t actually a large gap between the box and the drywall. If the box is too far back though, you would need such a large pile of washers to bring the outlet flush with the wall that the stability of the outlet could be compromised, possibly allowing outlet wire screws to touch the box and cause a short circuit. For this case they make certified electrical box extenders, kind of like a sleeve, that fills in the space.
Remember that all electrical work requires a permit -- some provinces allow homeowners to do their own electrical work and some provinces require liscensed electricians to carry out all such work. Click here for information on the LEGALITY OF DIY ELECTRICAL WORK.