Is it OK to put traces under castellated PCB
I would advise to prevent traces underneath submodules.
Soldermask is not an excellent insulator, and the thickness may vary.

Aside from insulation, you might encounter interference as well. Especially when these modules provide wireless functionality or power.

When you have to, check the module if there are any exposed pads or via's. And read the datasheet, so you can route around critical area's.

230 VAC, assuming from mains, isn't clean 230V. It already has a higher DC peak, and it will have transients. That would definitely be a no.

But when the module has nothing on the bottom, I have no arguments against it.