Article IX of the Outer Space Treaty requires parties to the Treaty to conduct their activities so as to avoid "harmful contamination" of celestial bodies, which would include Mars. This obligation also extends to the activities of commercial actors; Article VI of the Treaty requires States to ensure that their private actors' activities comply with Treaty obligations.
As far as what counts as "harmful contamination", right now most countries look to the COSPAR Guidelines as the most well-articulated set of rules to prevent contamination. The guidelines aren't themselves legally binding, but following them generally is seen as sufficient to meet the Article IX obligation. These guidelines would generally forbid the dumping of unsterilized human corpses, or other similar biological material, on Mars.
As for enforcement mechanisms, there aren't significant ones built into the Outer Space Treaty itself. Likely, complaints would be resolved through diplomatic channels, either through consultations and discussions in COPUOS, or directly between relevant parties to the Outer Space Treaty.
Edit to add additional information about crewed missions: The COSPAR guidelines don't have a lot of useful information about how we would handle the Article IX obligation in the context of a crewed mission to Mars (or Europa, or Ganymede,
or other relatively high risk locations). This is something the international community is going to need to articulate and develop in the medium-term.