You can do that, Take a dwarf fighter champion give him a d12 hit die instead of the +2 to strength or +1 to wis, give resistance to poison (they never had immunity), and eventually advantage vs. magic but if you do the latter then magic items have some chance not to work for himI'd love to see a Race-as-Class option for 5e. Like, let me play the dwarfiest dwarf. Extra stonecunning at higher levels (something like a passive perception), immunity to poison, and maybe even a return of the old dwarven bonuses to saves vs. magic.
An eldritch knight elf = Elf class
For the Halfling class Take a Halfling fighter and give him the criminal background
There, done with just some optimizing for your dwarf.