As others have mentioned, it's not quite that simple.
For starters, you can absolutely remove the word "fuck" from all the training data. Now it's literally impossible for the AI to "know" the word. But what do you do with the training data? Do you replace "fuck" with a different token? "****" perhaps? Or do you just drop the data entirely?
Giving "offense" is much more complex than just a single word. See, if we just replace the token, the AI may still decide that "Go **** yourself" is a perfectly valid response to a query. On the other hand, if you drop all instances of "fuck"from the data, your AI will just learn offensive euphemisms instead: "You can shove your request where the sun don't shine"
Worse, there are plenty of sexual / offensive phrases that are built up from perfectly innocuous tokens. "Prone bone", for instance.
The goal with these (and really almost all) AI models is for them to be "helpful, honest, and harmless". Simply alerting or replacing a single token (or even combination of tokens) doesn't really help, because the AI is modeling concepts, not just individual words.
All of this to say that the problem being solved is not to stop an AI from saying "fuck" - it's to build an AI that doesn't want to.