Interpretation of thermodynamics applied to whole universe gets me confused… While thinking about thermodynamics, I was confused about the interpretation of its fundamental concept.
If we assume the whole universe as a thermal system, and describe all energy transfer as a thermal process, then suppose someone is pounding a nail using a hammer. The nail will have certain temperature, and will be heated by the process.
If we describe the whole process as a heat flow, How should we quantitatively define the temperature of the system? Of course the energy will be generated from the ATP molecules inside the worker’s body. However, if we measure the temperature of the molecule by thermometer, it will just show body temperature of the worker. But we know that the temperature of the nail is higher than this. Seemingly the heat is flowing from low temperature ATP molecule to high temperature nail.
It seems to me that the law of thermodynamics are very general and universal. I thought everything should follow the law, but even this simple situation made me stuck. What am I missing?
EDIT1: Those two answers are usual answers which introductory courses provide; It has some value which I appreciate. However, when someone realizes that the muscle movement which provides directional momentum is even a chemical process which is in regime of thermodynamics, and brain function that determines the direction of the momentum is even a chemical process, then the problem is asking something beyond those two answers..
 A: The Universe, as well as the situations described in the OP are non-equilibrium situations. On the other hand, the standard thermodynamics taught in introductory courses is equilibrium thermodynamics, i.e., it is applicable to the systems where all the fast processes have ended, while the continuing processes are too slow and need not be taken into account ("too slow" on the scale of our observation time.)
The situation where a nail is heat by a hammer is manifestly a non-equilibrium one. The worker themselves are not in thermal equilibrium: they absorb energy from the environment in the form of complex molecules, extract these energy by oxidizing these molecules, and convert this energy to useful work (rejecting the rest of it in the environment, as any heat engine should, according to the second law of thermodynamics.) Thus, the entropy of the worker is reduced, and, by performing work, they may reduce the entropy in their surroundings - e.g., but hammering the nail. However, the entropy of the Universe as a whole increases as the result, and one can view the actions of the worker as a relaxation process of the Universe towards equilibrium.
It is however not obvious that the Universe is really evolving towards thermal equilibrium as a whole - notably, some of the assumptions used in equilibrium thermodynamics may not apply, such as possibility of neglecting residual interactions, ergodicity, etc.
A: 
If we assume the whole universe as a thermal system, and describe all
energy transfer as a thermal process, then suppose someone is pounding
a nail using a hammer.

All energy transfers are not thermal processes if by thermal processes you are referring to heat transfer. There is also energy transfer by work, which is the process involved when hammering a nail.

The nail will have certain temperature, and will be heated by the
process.

The rise in temperature of the nail is not due to heat. Heat is energy transfer due solely to temperature difference. The temperature of the nail increases due to work. In order for the temperature of the nail to increase due to heat, it would need to be exposed to something at a higher temperature.
That said, once the temperature of the nail increases due to work done by the hammer, there can be transfer of energy from the nail if it is exposed to cooler surroundings. In which case, the whole process can be characterized as a combination of energy transfer by work and heat.

If we describe the whole process as a heat flow, How should we
quantitatively define the temperature of the system?

Again, the whole process involving hammering the nail is a combination of energy transfer by work and heat. The kinetic temperature of the system can be quantified by the average kinetic energy of the molecules that has increased.
But not all processes that cause an increase in temperature are a combination of work and heat. For example, the compression of a gas in an ideally thermally insulated cylinder (an adiabatic compression) causes an increase in temperature by work. There would be no subsequent heat flow because the system is thermally insulated.
With regard to the "worker", the worker supplies the energy that is transferred to the nail in the form of work. That energy is derived from the conversion of chemical potential energy from the molecules of the worker.

But we know that the temperature of the nail is higher than this.
Seemingly the heat is flowing from low temperature ATP molecule to
high temperature nail.

The mistake you are making, once again, is thinking that the energy used to hammer the nail is heat, which of course only naturally occurs from high to low temperature. But that is not the case here. It occurs due to energy transfer from the worker to the nail in the form of work, not heat.
Hope this helps.
