It will be ugly, but I am aware of no code rule that would stop you from using an extension on a surface mounted handy box.
However I can't imagine why you would; it would be just as easy to switch to say a 4x4 box with a raised industrial cover, plenty of room inside, and it would protrude less, and it wouldn't be so ugly.
As mentioned in @Harper's answer, you will have to trim the tabs on a Decora device to get it to fit in an industrial cover.
If you'd rather not trim the decora dimmer to fit the industrial cover, you could use a mud ring on the 4x4 box, but I wouldn't - the plate will not lay flat and the corners will stick out like they do in the current handy box. I don't like that appearance, it's prone to chipping and cracking the cover, catching on things, etc.
If you really don't want to trim the tabs on the decora device, bump up to an even bigger box - a 4-11/16" square box, sometimes called a 2100 box. A 4-11/16" flat device cover is big enough that the plate will lie flat with no corners sticking out
or for a really finished appearance, spend a few more dollars and use a 4-11/16" decora industrial cover.