###Try explaining practical impacts of forging ahead with a campaign-inappropriate character.
The other answers are excellent, but if players remain attached to their inappropriate choices even after Session 0 discussion, the following may be of use.
In my experience, tabletop players tend to primarily focus on one of two areas with regard to their characters: how awesome they are, or how they'll deal with challenges and limitations. Both are fine, but in this case it seems that you might want to emphasize the latter while your players are thinking of the former.
I ran a long-term game of Vampire: The Masquerade for a while and one of my players was interested in a character that would have been an odd fit for the setting. We talked about it and I explained that, while it was a cool character, there would be a lot of obstacles and limitations to their activities in-game as a result. This included an overview as well as specific examples.
In the end, the player was excited by the limitations. They wanted to move forward with the character because they thought those constraints sounded like interesting challenges to deal with, and that dynamic ended up letting me really emphasize the themes and tone of the setting. The character's poor fit to the setting ended up producing some really interesting plot developments, and because the player went into the situation with open eyes it never felt unfair when they encountered those extra obstacles.
Something similar might be useful in a case like yours. It's definitely within your purview as DM to simply forbid Wizard as a class your PCs can take. If a player is especially attached to the idea of a Wizard for their character, you can express what your setting means for them:
- A secret which will cause massive (perhaps insurmountable, in some
dimensions) difficulties if anyone learns of it. That involves plot
hooks, like blackmail, but also day-to-day constraints, like having
to be very selective of when they cast spells or taking extra pains
to hide a spellbook.
- A poverty of available spells. If wizardry is so rare and forbidden,
a Wizard character is going to be very limited in their ability to
expand their spellbook.
- Less utility overall. The obstacles to spellcasting will, in
themselves, really limit a Wizard from getting what the rules intend
out of their class. Some other skills, like Arcana, might also be all
but useless.
Those factors might also produce some opportunities in which a pacifist Wizard might be extra effective, if living dangerously:
- Magic being extremely rare may also mean that everyday people are far
less able to recognize it than is typical for D&D. While it's a risk
to ever cast a spell in the setting, it may be less noticeable than
would be typical.
- With any kind of magic being rare, people might be far more ready to
accept an illusion as real. A clever illusionist might confuse and
distract enemies to the extent that a fight is totally avoided
without them ever being the wiser.
- Largely unavoidable violence is a great way to explore pacifism as
a theme. Can this character maintain their outlook and succeed? Or
will they be forced to compromise their ideals to accomplish their
greater aims?
Finally, not every character "wins" every campaign. If the normal end of magic-users in your setting is violent and arbitrary, that can happen to your player too. Not all players are up for that sort of thing, but it can make the story poignant in a way that would otherwise be difficult or impossible to achieve.
tl;dr:
A character that is fundamentally incompatible with a setting may not be usable (i.e., a setting where Sorcerers inherently don't exist isn't going to work with a Sorcerer PC). But a character that is a poor thematic fit for a setting can offer contrasts and new angles to explore those themes.
It's just that a character focused on features that mesh poorly with a setting will have a game more focused on limitations, struggle, and adversity than is typical. A player can still enjoy their character and the game as long as the player is aware that their character's in-game experience may be particularly challenging or uncomfortable.