The zeroth law of thermodynamics:
"If two thermodynamic systems are in thermal equilibrium with a third, they are also in thermal equilibrium with each other."
The first law of thermodynamics:
"In any process, the total energy of the universe remains constant."
The second law of thermodynamics:
"There is no process that, operating in a cycle, produces no other effect than the subtraction of a positive amount of heat from a reservoir and the production of an equal amount of work."
The third law of thermodynamics:
"As temperature approaches absolute zero, the entropy of a system approaches a constant. "
There are also proposed fourth, fifth, sixth, and other laws based on other principles, but we will stick to the basics here (bet you never heard of the zeroth, though).
Most people, when they bring up the laws of thermodynamics, are referring to the first law, which is also called the Law of Conservation of Energy. Basically, the conservation of energy states that the total amount of energy in an isolated system remains constant, although it may change forms, e.g. friction turns kinetic energy into thermal energy.
When you are learning physics in high school, you test these laws with some simple experiments, usually involving burning a specific quantity of material and seeing how much it heats up a container of water. Or, you might be observing a change in temperature from one object to another as the heat is transferred. Very simple, very simplistic.
Many mechanical engineers will tell you that thermodynamics, even among non-living things, is way the heck more complicated than all that. But, it is also important to remember that changes in energy are only simple to identify in isolated, closed systems. It's very easy to tell that, when your cup of tea cools down, its surroundings become warmer.
However, as is obvious to most people who aren't disingenuously quoting science they aren't familiar with to prove a point that isn't valid, a living organism is much more complicated than that. It isn't simply that we ingest calories and expend them with physical activity like a car does with fuel; it is that we are so very complex that even our brightest minds have not unraveled the biochemical nature of our very being.
In other words, calories in/calories out is a ridiculously simplified idea that in no way actually describes what is actually happening inside the human organism. Never mind that we aren't taking into account the size of a person's mitochondria, the differing ability of each person to digest food, and the plethora of non-human organisms that dwell in every person's body; never mind that they've found that the second law of thermodynamics doesn't seem to hold true for microscopic systems; even if our bodies did operate so simplistically, we simply cannot account for the use of every calorie consumed with simple math because there is no way to monitor each muscle twitch and every degree of heat produced.
It's a moot point; thermodynamics does not really account for life. Part of life is the denial of entropy; to take energy and harness it with some degree of purpose. Without my being alive, the glass of tea on my desk would not simply move itself from one place to another. There would be no physical science reason for it to do so. The will demonstrated by the tiniest forms of life demonstrate the ability to change matter and harness energy toward a purpose that would simply not be possible as a random act of nonliving matter and energy.
Much of our organic design is for the purpose of opposing the forces of physics. Organisms that live on land must expend enormous amounts of resources to defy the pull of gravity. Terrestrial plants build structures out of cellulose in order to remain upright. Aquatic plants, buoyed by their surrounding water, are much more tender; it is easier for you to eat and digest kelp than for you to do the same to woody plants. We need a sturdy skeleton of hard bones to keep us functional on land; fishes' bones are generally fine and delicate, and the majority of organisms in the sea rely only on hydrostatic pressure to keep them from collapsing in on themselves (jellyfish or squid, for example).
We take energy and matter and organize it into specific ways. We grow new tissues, repair damaged parts, and, ultimately, pour a great deal of energy into the race to replicate ourselves before the laws of physics take their toll, a process that is so powerful that those of us who choose not to reproduce must expend enormous effort to counter it. We resist deterioration for as long as we can, our cells working autonomously to keep us going despite some of the worst odds. Life exists in defiance of entropy.
So when I hear someone saying that it's as simple as "finding how many calories your body needs, and only eating that much", you'll have to pardon me while I laugh. Do you even know HOW to measure how many calories you use? Despite the nifty little charts on every elliptical machine, my body does not expend the same amount of calories to do the same activities as yours. There are little mathematical formulas that you plug your height and weight into, and these are notoriously inaccurate. There's a machine that measures how much oxygen and carbon dioxide you are breathing out. Some studies measure metabolism in cell cultures by measuring heat production. There are sensors in development to measure parameters at the cellular level, too.
However, most of the methods that are relatively accurate were not created to measure the metabolism of a multicellular organism. They are for scientists who need to determine how much energy is being used by cell cultures for various reasons. The truth is, there isn't a terribly reliable way to see how many calories you are burning.
Even if we could tell, there are so many other factors involved. For example, you do not necessarily digest everything you eat. If you've ever eaten corn, you know exactly what I am talking about. One person's ability to utilize the food in their bellies efficiently is different from another's. I don't digest fats efficiently because I don't have a gallbladder. If I eat fatty foods, I will be rewarded with the unpleasantness associated with an inability to completely digest the fat, an unpleasantness similar to the effects of eating too much fat while taking Xenical or Alli. A friend has Crohn's disease, which, through damage to her intestines, leaves her ability to absorb nutrients compromised (interestingly, I've known several women with Crohn's, and while one was very thin, the others were on the heavier side of average).
Let's also not forget about the natural flora and fauna living within every person's body. You're full of cute little bacteria, and your set of bacteria may be different and more or less efficient than my set of bacteria. You might have a pet tapeworm to feed, or maybe you're nursing a colony of roundworms. It's almost impossible to tell what bacteria you've got and how many, or whether you've got a load of dependents that you didn't expect. You just don't know!
So, when I eat a meal, the different components of that meal are digested and utilized in different ways. Maybe I ate 300 calories, but 25 of it was fat and just went right through customs without so much as a luggage search. One bite of that potato went to Tapey, and about 100 calories of the meal was expended on the panic attack I had when I couldn't find Marcus, my yellow rat snake, who had quite cleverly burrowed so deep into the substrate that I thought he'd escaped.
Finally, I want to say something about fibromyalgia and other physical ailments. There is some research that indicates that sufferers burn much more energy while asleep than non-sufferers. It's like we're stuck in second gear while waiting for a stoplight. Some people have insulin resistance, which affects their ability to utilize carbohydrates--so the body stores them instead of burning them. Others may have thyroid problems; hypothyroidism results in weight gain and slow metabolism, while hyperthyroidism results in the opposite. The hypothalamus, which can change metabolism, can be damaged or abnormal, resulting in a wide range of results including anorexia and weight gain.
So, to put it very succinctly, no, it's NOT that simple.