Is it legal to place an outlet below a light switch in an old house with no studs in the walls?

What's holding the wall up then? You can get what's called an "old work" box the will use the wallboard as its support.