By default all Random and Random from Set options in the map would obey this rule, but for a certain Hero/Settlement/Wandering Monster Stack you could allow it to ignore it if it includes something from the banned set.
For anything customized that is fixed to the customized position (such as Hero/Gladiator Skills or Types, fixed wandering monster types or sets, chosen specifically by the map-maker), the fixed stuff doesn't have to obey the global rules. As in H4, you could give a hero a banned skill. But as well as allowing that skill to upgrade with level-ups normally if they start with it or gain it through an event, there could also be two other options:
a) Can't upgrade the skill from its starting proficiency from level-ups.
b) Can upgrade the skill from its starting proficiency, but only after all other options are exhausted.
Events and scripts could obviously overrule this because they are custom-made and intended.