Falcon 9 has a heat shield around the engines. Since they are going into the atmosphere engines-first it's going to be hot there. The engine bells sticking out from there don't care (much, since the entry burn reduces speed enough). Most of the speed reduction for the landing happens via aerobraking, not by using the engines.