How do I fix a protruding electrical box? (Info in comments)
If the box is as bad as you say and the other suggested methods don''t work, you can use a multi tool or sawzall (very, very carefully and slowly) to cut the nails holding the box to the stud.