Fundamentally, it comes down to the conservation of energy, since we already know the initial velocity of both objects, by simply measuring the velocities of the objects just after the collision (say ${v_1}$ for object 1 and $v_2$ for object 2), we can calculate the amount of energy converted to heat by simply using,
$$
{ m_1v^2 = m_1v_1^2 + m_2v_2^2 + Heat}
$$
For this I have assumed that during the collision, no extra energy is introduced into the system or lost from the system. For example, in real life, if two cars collide, and the engine of car 1 explodes, this introduces energy into the system which must be handled separately.
Thus for this, we can modify the conservation of energy as,
$$
{ m_1v^2 + Energy~introduced~into~the~system = m_1v_1^2 + m_2v_2^2 + Heat+Energy~lost~by~the~system}
$$
EDIT: If only the initial conditions are know, although it is theoretically possible to find the velocity of the object before collision, practically, this is near impossible for complex systems such as the example you have pointed out. However for simple systems, it fundamentally works down that all the forces during a collision are electrostatic in nature (rarely gravitational), if it is possible to list all the forces between the individual molecules/objects, then yes, it is possible.
EDIT 2: As for the equation, it would be a second order ODE if you factor in all the force components (as F = m * a = K/(r^2) ). As it is a differential equation factoring in n-forces it does not have a simple equation form which can be written out.