You've got no idea what you're talking about so sit this one out.
If you train a model for DETECTING nudity/sexual content, and add it to the pipeline without potential user override (so no "ignore all previous commands BS"), then the generative model doesn't need to know anything about that kind of content.
But you'd still need to train that detection model.