Generally speaking, people are NOT notified you are on DND on iPhone. If you are using a Driving Focus and they text you, you can have your phone send a message you are driving and not taking messages. if you have enabled the "Share Focus Status" feature, contacts who are part of your focus group may see that your notifications are silenced, but they won’t know specifically that you are on DND unless they are using iMessage and have the feature enabled.
If you thought everyone would see a notification you are on DND, that is not really a feature.