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.