Plastic electrical cut-in boxes with 3/8s tabs
It is certainly acceptable for the boxes to sit back a little;  NEC 314.20 allows a flush mount box to be up to 1/4&quot; back in a non-combustible material like drywall.  (See below.)  But without a doubt it makes installing the devices (switches and receptacles) more of a pain.
There are plastic boxes that work fine with 5/8&quot; drywall.  You can nail on a nail-on box where ever you want.  There are nail-on boxes that have alignment tabs for 1/2&quot; and 5/8&quot; drywall.  There are also adjustable depth plastic boxes such as the Carlon Adjust-A-Box.  These have a screw adjustment to get the box exactly where you want it.
With metal boxes, you mount the box flush with the face of the stud, and buy mud rings to match the depth of the finish.  There are 5/8&quot; mud rings for 5/8&quot; drywall, readily available any electrical supply.  This makes installing the drywall easier too.

314.20 In Wall or Ceiling. In walls or ceilings with a surface of concrete, tile, gypsum, plaster, or other noncombustible material, boxes employing a flush-type cover or faceplate shall be installed so that the front edge of the box, plaster ring, extension ring, or listed extender will not be set back of the finished surface more than 6 mm (1⁄4 in.).


In walls and ceilings constructed of wood or other combustible surface material, boxes, plaster rings, extension rings, or listed extenders shall be flush with the finished surface or project therefrom.