No, never, that is the very bad tactic; moreover the children’s curiosity increases.
You know from your childhood, the most interesting things are the one which is not allowed or prohibited. You allow them to taste everything and explain them why it is good or it is not and tell them also they could eat it rarely. In the long run they slowly omit these unwanted things and explain their friends also why they should not do it. It is better to allow the children to do the mistake, then they have enough time to correct, but if they do the mistakes when they are adults, you may not have the possibility to correct this. This is applicable to all fields.