Well ... it's not like training a dog or anything.
The truth is that most junk foods are extremely salty, rich, oily, or overly sweet when compared to food in it's natural state. Or some combination of those things. Most of us are used to the extremes of flavor that our society has pushed on us ... the saltier, the sweeter, the more sour ... the better. But you eat more healthy foods, you will eventually find that what used to appeal to you, doesn't taste good any more. I know that sounds odd, but it will happen.
I know that now I can't eat McDonald's fries any more - most of the time they're too greasy and salty for my taste, but even if I get them super fresh and unsalted, they upset my stomach if I eat more than a few. That's because my tastes have changed and my body isn't used to consuming that much fat anymore.
Same with sweets. I used to be able to eat a King Sized Snickers bar and drink a Coke w/out even blinking - or eat a big piece of grocery store cake with that sugary frosting. Now, I've been eating naturally sweet fresh fruit for so long, that the candy bar tastes *too* sweet to me. I never thought I'd be the person who turned down dessert as "too rich" but I've become that person.
Our bodies are adaptive and that goes for our tastes, too. Your taste buds are constantly shedding cells and growing new ones. So you can teach yourself to like any food by eating enough of it. You can wean yourself off of sweets or fats or salts by eating less of them. You can grow adapted to spicy foods or sour foods by including them in your diet.
So, I guess maybe it IS kinda like training a dog.
Do it enough times and it becomes natural.