My mother in law to this day uses both dolce and caramella for candy. She'll ask: vuoi una dolce (dolcetta) or dei dolci? for a piece or some candy? Her Italian is heavily accented, but her attempt of standard. We still visit relatives near Pordenone. The dialect there is very interesting - friuliano, but it is disappearing. She also uses dolce for dessert and of course for cake. I'll have to ask someone for on FB!
True, but that means variety...different types. I suggest adding the count noun a piece of candy or two pieces, etc. saying: I want three candies meaning individual pieces, not different types, is not said in the Cleveland area. It is the same for sugar: we need two sugars for Halloween - a green one and an orange one. Otherwise, we say cube, packet, teaspoon of sugar.
It is popular in baking jargon for sprinkling on cookies, etc. Different colors are used depending on the holiday. The green and red sugars are popular for Christmas. Again, we might ask which sugars do we need for ... ? (the next holiday coming up). Otherwise, we too do not simply say sugar for candy.
I ran ito this in the DL French lessons. If the problem is the same here, it is in the article> Put "il" when "la" is required and DL will correct with the word associated with il, (il dolce) - Put "la" when "il" is expected and DL will correct to the associated noun, in this case LA caramella.