No-patch solution - change table playercreateinfo in world database and make not allowed races and classes start in some kind of jail. Or you can edit your server config files (however, I don't know why, it didn't work for me last time).
Path solution? Google my friend. Google and reverse-engineering. And trying to sweat something, not making others to bring it to you. There are more ways how to achieve this. I'm not sure how much damage simply deleting some race would make (I in general lack experience in editing races, never did it before) so I will help you only with classes and quite simple way to erase them - you will need to delete them in CharBaseInfo.dbc. It contains all allowed combinations of races and classes, so if you delete row with race=1 and class=1, human warrior will no longer be allowed. Which class/race has which ID? Google it. And yes, it will not mean you have deleted those classes - you will only lock them (but they will still be shown in character creation screen for instance). You can try to disable all classes for unwanted race - I have no idea what it will do, if it won't cause any errors it's probably the most simple way how to lock them.
However, if you want to add new combination of classes and races which wasn't here before (for instance dwarf shaman in preCata), you will also need to add their rows into your world database (table player_levelstats). At least add row for level 1, otherwise server will crash at startup (higher levels will be taken from elvel 1 unless you add their rows too).