If it is the compressor causing the noise (very possible) it is NOT likely to be dangerous to anything other than the compressor itself but I have seen fridges continue to operate properly in that condition for years. However, if you can't stand the noise, you'll have to have the compressor replaced ($$$+) or replace the whole fridge.
What most often causes the noise is that the compressor bits are mounted on springs (like shock absorbers) inside its housing. These springs can weaken or break and be unable to cushion the starting or stopping torch of the internal motor. This results in the compressor innards striking the outer housing.
There is no way to service the small compressors (used in domestic fridges and freezers) itself.