It's always calories in/calories out, but people forget that calories in are far easier to measure than calories out. The also forget to consider the possibility that what is taken in might affect the rate calories are burned or even if they're burned.
Flax seed and many other seeds can only be digested if the seed casing is cracked or broken. Whole flax seed are calorie-free for humans if they're not ground or chewed to crack or break the seed.
Corn is another food that isn't always completely digested.
Fiber, sugar alcohols, resistant starch... all contain calories that humans can't digest or can only partially digest (and undigested calories are unused calories).
It's surprising to me that "all calories are equal" logic is still commonplace. By that logic, we should be able to eat wood and hay.