It is possible for a refrigerator compressor to overheat but it's also very unlikely since the refrigerator compressor is equipped with a thermal overload protector which will or at least should shut down the refrigerator compressor before it gets to the point of overheating and starting a fire.
If your refrigerator compressor is running constantly and not shutting off at regular intervals then it's likely your compressor is bad or the refrigerant level in the refrigerator is low due to a leak.
It's usually cheaper and better to just replace the entire refrigerator depending on the age of the refrigerator and the cost of the refrigerator.