While, yes, the DM has the final say,
nobody likes a DM that actively blocks you from playing the game.
There's reasonable DM control, such as, "No, you can't have that at this level, I know just how hard that would throw the game balance and you aren't allowed to fuck up my entire campaign this early." The kind of DM that knows the player characters are going to be ridiculous and probably upset parts of his campaign, but stops one development from happening too early? Perfectly reasonable.
And then there's unreasonable control, such as making your players make new characters because their current ones don't perfectly fit his paradigm. Or pulling instakill bullshit because he says so after a player cleverly maneuvers past their obstacles.
Players are allowed to build their characters within whatever restrictions the DM allows. DM says no gun-based classes because low/no tech fantasy? Okay. DM says magic is rare and belongs to noble families? Sure. DM restricts certain feats because of campaign restrictions? That's fine.
DM says that your character retroactively can't build the way they are because he didn't think of how that one solution would solve his campaign? That is not okay, the DM is not supposed to create the characters for the players unless he's teaching them how the system works first.
DM says that the action you took, despite succeeding beyond any possible difficulties, fails? Very, horribly not okay. And before you start pulling some sort of bullshit example, I'm talking about actually, measurably succeeding, not just getting a lucky roll on something that's still impossible to do.
Tabletop at it's best is a story-building game between several players. The DM is not the writer; he is the background, he is the setting, he is all of the characters that the other players are not. He is the law of the world, but he is also bound by that law.