Marine refrigerators usually run on 12V power.
That is the reason that yours continues to run even though it may not work when connected to 120V. In order to operate on 120V these units come equiped with a converter or transformer to reduce the working voltage to 12V. It seems your converter may have gone bad or the wiring or connections are not transferring power. Start with the basics, insure there is 120V power coming form the dock outlet into your boat and check your boat 120V breaker and any unit fuses . Your converter may be a small part built in to the unit or may be a stand alone converter. A wiring schematic of the refrigerator may be helful to locate and replace the converter if every thing else checks out. Be careful purchasing electrical parts as they are usually non-returnable.