We know there is conservation of mass and energy in nature. Any chemical engineer can write mass and energy balance equations that represent this conservation.
Calories in = Calories out is an simplified form of a more complex energy balance equation that looks something like this:
(Enthalpy in) - (Enthalpy out) + (Heat/Energy crossing boundary) - (Work) = (Change in Internal Energy/Accumulation)
... plus a few more equations that represent component energy balances.
Calories in = Calories out makes some naive assumptions and neglects all the internal biochemical reactions, and hence presents a skewed picture of the thermodynamics.