Or putting it another way - when is a calorie NOT a calorie?
When it comes to weight loss, the only thing that really matters is "calories in versus calories out."
In other words, if you burn off more calories than you eat for an extended period of time, you will lose weight, regardless of the source of those calories. For example, if a woman eats 1400 calories a day, she will definitely see a difference on the scale, whether those 1400 calories come from a balanced meal plan or a diet composed entirely of Big Macs, chocolate chip cookies, grapefruit, or cabbage soup.
That said, quality of calories is just as important as quantity when it comes to health and nutrition. Eating just one or two foods will not allow you to get adequate amounts of vitamins and minerals, or a balanced intake of carbohydrates , protein, and healthy fats.
Health considerations aside, a "Big Macs only" or "exclusively cookies" diet plan probably still wouldn't work long term, because it's hard to imagine you'd stick with it for more than a few days. In order for a diet to be effective, it shouldn't be too different from "normal" eating.
If your weight loss plan is too bland, monotonous, or restrictive, it will perpetuate an on/off mentality that inevitably leads you to abandon the diet and regain lost pounds. You're better off sticking with a varied and balanced weight loss plan