2 schools of thought on this... I tend to do it with my boys but they ar 5 & almost 7 & I *know* that their taste buds are on the downward spiral. At 2yo I wounldn't have done it because I worked out early that my children were at the "hypersensitve" on taste (as was I) side of things & so some foods were quite simply too much. So as I was a limited eater as a child (at 2-4yo ate about a total of 20 foods) but out of my siblings I am the most varied eater, so I work on that & now my DS1 is almost 7 his diet is growing by the day & he likes broccoli now

where no way at 2yo.
Also toddlers/children are very seasonally sensative & so tend to actually prefer foods that are in season eg they actually often don't like the food when it is not seasonal & local (I've seen it every year with Bananas & beans for my 2) So maybe try a veg that is in season & see if that makes a difference.
The other thing, we didn't have desserts for our family until about 12months ago (although DH & I would eat them as a snack after children in bed if we wished) as I didnt' want to get caught up in the yucky food/nice food situation. For us "sugar" foods have always been part of the day & they could choose 2/day & pretty much when they had them (as long as after Breakfast) & Desserts came under that (as did Jam/Jelly, flavoured milk, cookies etc) Now that they are a bit older & eat better variety & do HEAPS of physical activity they are actually up to 3 (4 on weekend), but if they say have a cookie & flavoured milk & a Jam Sandwich for lunch, then they know dessert will be fruit irrespective of the veg that is eaten.
One thing that has always worked well for us is the "5 things on the plate" so for Dinner there is always 5 things, it used to be 1-2 that I knew they would eat then 1-2 that mostly got eaten & 1-2 new foods to make a total of 5 things. There were no seconds of those that were well liked unless parts of the others were at least tried. I needed to do that because quite simply (even though DS1 ate pretty well until he got sick at 10mo & spent 3 days in Hospital) DS1 needs to be exposed to foods about 100+ times before he will eat them & so he learnt to accept that if he didn't want to eat it he just left it on the side of his plate, same goes for DS2.
At the end of the day, I laugh because My Mum has always loved Dessert & when I came back from living Overseas in my early 20's she'd make an assortment & I'd not eat them & because I was a vegetarian at that stage I'd eat heaps of Veg & I'd say to My Mum "see if you eat your veg, you don't want dessert, so not sure how it works"