Mine are 4 and 6 now, both have been through phases of demanding crap rather than eating their dinner. I've always just said no, and that dinner is what is on the table, you don't have to eat it, but that's all there is. And that food can be rejected, but only if they give it a good try first. This has been largely successful, although they both have good days and bad days, and ds especially can be a bit fussy.
With treat foods we've got into a routine now where they get their treat (yogurt, fruit, small square of chocolate, or an ice pop) after they have put their pyjamas on for bed. So, there is no relationship to dinner, and there are no alternatives offered at dinner time if they don't eat. We compromise with that by making sure we serve some things they have liked previously at every meal, and sub some things in and out if we need to, eg ds loathes fish, so when the rest of us have fish, he gets chicken or sausages for example. I don't cook whole separate meals though, we all eta largely the same thing and together at the table too.
We serve new stuff alongside things we know they like, so we know they will eat something. We also talk a lot about the fun of trying new foods, and I tell them for example about the times I've travelled and tried new things and how much I enjoyed that. I try hard to avoid the battles and focus on the positives of new foods, new experiences etc.
Some nights it's hard, they turn their noses up at things they loved previously which drives me nuts. But then in the same way, they decide they like things they previously hated. So you win some you lose some. Except on the fish thing, I think ds is pretty much committed to hating fish now.