Heat (thermal energy) is simply the kinetic (vibrational) energy of atoms in a substance. When one strikes a hammer against another solid material, the kinetic energy (and momentum) are transferred from the moving hammer to the solid material (mass). Assuming that the mass does not move, the kinetic energy of the moving hammer is transformed into sound (acoustic energy, or pressure waves) and heat (thermal energy) in mass of the solid and the hammer.
A hammer blow (impact) is an example of an impulsive load, i.e. the force (and pressure) are applied over a very short time.
One can also generate heat by friction, which is a shear force. Friction dissipates energy as heat.
Thank you. I actually ended up having a conversation with one of my physics professors about this. She also said that it was the mechanical energy from the hammer transfered into the metal and causing the molecules of the metal to vibrate and oscilate and thus converting the mechanical energy into thermal energy.