It does and it doesn't. If you want to lose weight, you have to be in a caloric deficit, period. If your maintenance calorie level is 2,000 calories a day, and you eat 2,500 calories of lettuce every day, you will gain about a pound a week. If you eat 1,500 calories of Twinkies every day, and nothing else, you will lose about a pound a week. It's as simple as that.
That said, the quality of your food makes a HUGE difference. Generally, calorically dense junk food is not filling and will leave you hungry in a couple of hours. The best bet is to shoot for a truly balanced diet, minimizing white carbs and processed food, and maximizing REAL food, that is, food that has not been extensively processed.
Diets based purely on the type of food you eat are basically "gimmick" diets. They work by putting you in a caloric deficit.