You can. I said I don't, and becasue if this, I don't find classes restrictive in this regard (with the exceptions noted)
There are generally no thematics that specifically apply for a class except as it relates to Warlocks and Paladins. There are no mechancial ties to them. There are stereotypes or generalities associated with the classes, but those are mutable.
After Warlocks and Paladins, Clerics are probably a very distant third, but even with them there is no requirement at all to worship or pay homage to a deity and D&D fiction is filled with examples of clerics who do not worship (and in some cases even despise) their deities.
Warlock and Paladin are specific because of the Pact and the Oath specifically. It is pretty hard not to have those things affect the story unless you completely handwave it away.
Okay, but like...everything affects the character. There's nothing special about class that makes its effect different from the other sources.
If you play a Noble background Barbarian, that implies some interesting contrasting elements. If you play an Urchin Paladin, that implies some interesting contrasting elements. Etc. These things feed into one another, regardless of what you pick. So, why is Wizard in any way special here? It has the inherent flavor of being an educated magic-user (though, as stated, the game is terrible at actually
supporting that flavor.) That makes for a highly consonant thing if you choose the Sage background, but a fairly contrasting story if you pick the Sailor background.
Likewise for race. Stereotypically, wizards are elves. But you could be a Dwarf Sailor Wizard, and that's going to have implications.
I don't see why Wizard is in any way distinct or special compared to any other class,
including Paladin and Warlock. Yes, those things come with some strong flavor, but you can still do a ton with it, e.g. a Warlock could have a pact with her own future self (a great concept from 4e), or with his ancestors (the Abhorsen series can be parsed as an anti-necromancy Warlock family with a "pact" to their own ancestors), etc. A Paladin's Oath can be purely to himself, or to an eldritch being, or to the crown, or...
It all has to be made to fit together. Nothing is a
totally blank slate, not even Fighter or Wizard. That's why it's unflavored oatmeal and not
air; oatmeal still has a bit of flavor and texture to it, even if it's pretty minimal.