Assuming that the OP is talking about putting expanding foam inside the box and code and fire and safety issues aside.
I would like to focus on the matter of karma. Or voodoo. Or vendetta. Or evil eye. (pick your system of belief).
One day, in the near or distant future, some one other than yourself will need to access the outlet. Foaming the inside of the box will make this task so ridiculously more complicated that the poor sot will:
- curse your name for eternity.
- Or make little burlap dolls of you to stick pins in.
- Or you will be punished by the universe for doing this bad act.
Or, if you are really, really unlucky, some crazed DIYer will hunt you down, find you, and personally and creatively make you pay for your misdeeds.
BTW - The last one is my own personal fantasy regarding the former owner of my home. :whistling2: