This, unfortunately, is not true. Unfortunate cause I think great things would happen if it were that easy. It's also super simple to understand, which is at least part of why people cling to it so tightly.
There is a huge amount of scientific literature (see summaries by Gary taubes, for example) that show that calorie counting is not the whole picture when it comes to health or obesity. It's also definitely not a golden rule.