Rubber is a bit of a special case, because it is "elastic", it heats up when stretched and cools when un-stretched.
see https://depts.washington.edu/chem/facilserv/lecturedemo/EntropyofRubber-UWDept.ofChemistry.html
As Niels answered, materials heat up when "plastically" deformed, because of "friction" when you drag sheets of atoms across each other. From a materials perspective this is about tearing up dislocations within the lattice, the stronger the dislocations, the more force is required and work = force * distance = heat generated. Slippery materials like axle grease, don't have dislocations, so the lattice layers can slide across each other with near-zero force hence near zero work and near-zero heat.
Regarding "heating ... due to compression/stretching of chemical bond" , Actually bending doesn't heat up perfect materials. Some years back we worked with an extremely sensitive accelerometer system, that used a beam of etched mono-crystalline quartz. It was frictionless (i.e. so didn't generate any heat) if you achieved a perfect vacuum inside, so there was no heat generated by flexure of the beam. The residual gas atoms inside the accelerometer contributed a measurable noise floor, and lowered the Q of the pendulum due to friction of the gas molecules.