It might help to know what brings you to ask the question. I mean- is this just to settle a bar bet, or is there a real situation?
We've all seen pictures of tuna cans and the like used as "junction boxes," and they're certainly not proper.
It's also true that most of us have had local shops fabricate things that just were not available commercially. In my case, I've had a panel cover and a large pull-box extension made. With metal of similar material, and a matching paint job, inspections were never an issue.
For me, the guiding question is: If I sent this piece to UL, would it pass?