Refrigerators give off a burning smell when there is a buildup of dirt and dust in the workings of the appliance. They also emit a burning smell when there is damage either to the components or to the power cable leading to the refrigerator. You should investigate any burning smells as soon as they are detected to prevent further damage or even an appliance fire.
A burned out compressor will cause a refrigerator to give off a burning smell. Similarly, compressors that are in danger of burning out completely will emit a burning smell while they draw too much current from your power supply. Dust on the terminals on either end of the compressor will get hot while the refrigerator is running, which can also cause a burning smell. Clean the terminals, then replace the compressor if the smell persists.
The condenser coils often get coated in a layer of dust and dirt while the refrigerator is running. When the condenser gets hot, the dust and dirt get warm and begin to burn. This causes a burning smell that can be remedied by turning the refrigerator off, cleaning the condenser coils thoroughly and then turning the refrigerator back on again.
Damaged electrical cords often overheat, and this leads the insulating plastic surrounding the damaged cables to overheat. Melting plastic gives off a strong burning smell and can be a fire hazard, so it is important to turn off the refrigerator, check for damaged wiring and replace any damaged power cables you find before the refrigerator is turned back on.