There does not appear to be a general method for resolving disputes between races1, suggesting a lack of universally-recognized legal system (or treaties between the systems of different races).
We see this become a problem in The Hobbit, when the Dwarves, Elves, and Men of Dale decide to resolve the ownership Smaug's Horde using the time-honoured tradition of Bigger-Army Diplomacy. Presumably the contract the Dwarves drew up with Bilbo was designed with exactly this in mind; if he agreed to the terms of the contract (which we don't know entirely what they were), then there would be no cause for him to resolve his grievances by summoning the Grand Army of the Shire.
It's not clear what would have happened if Bilbo had breached his contract.
Disclaimer: I am not a lawyer, but I have studied basic contract law
In an international dispute, parties can usually pursue action in one of three places:
National courts. Jurisdiction would need to be determined, but in the absence of a common law court system that's probably not much of an issue; action could be brought to a court essentially anywhere in Middle-earth, although either a Dwarvish or Hobbit court would be the most logical.
Arbitration. Bilbo and the Dwarves could decide to choose a private arbiter to resolve their dispute. In Middle-earth, where the court system is underdeveloped (at best), this is most likely what a national court solution would devolve into, though arbitration doesn't suffer from the jurisdiction problem.
Any person in Middle-earth could arbitrate, as long as both parties accepted their authority; Gandalf would be a plausible person to do so, as would the Steward of Gondor. Someone like Elrond (mistrusted by the Dwarfs) or a Dwarf-king (probably untrusted by Bilbo, because of conflict of interest concerns) would be unlikely, but not impossible.
International tribunal. This doesn't really apply here, since in the real world this only usually happens when a government is accused of violating international treaties. It's also not clear what sort of tribunal might exist in Middle-earth; the only trans-racial coalitions I can think of in Middle-earth are:
- The Last Alliance, which is defunct by the time of The Hobbit
- The White Council, which is super secret, substantially Elvish, and not known by outsiders to be trans-racial (since most people don't know the truth about the Wizards)
- The Fellowship of the Ring, which doesn't exist at the time of The Hobbit
In theory an international tribunal could be set up for this purpose, but it seems stunningly unlikely.
All of these forums suffer from a significant problem: in order for their judgements to be effective, there needs to be something preventing one party from violently protesting the judgement. Whether this is the case or not is...questionable.
Interestingly, the contract shown in the movie is actually a real contract, and a remarkably good one. James Daily, an honest-to-goodness lawyer, analyzed the contract in a post on Wired.com, and discusses it in great detail that I won't go into.
I will, however, note two clauses relating to breach of contract.
If the Dwarves breach the contract, Bilbo will be compensated with gold:
Burglar acknowledges that monetary damages alone will be adequate compensation for a breach of this contract by the Company.
The contract specifies resolution by arbitration, the arbiter to be chosen by the Dwarves and all arguments to be in the Dwarvish tongue (presumably Khuzdul):
Disputes arising between the Contract Parties shall be heard and judged by an arbitrator of the Company’s choosing and all pleas shall be pleaded, shrewed [sic], defended, answered, debated and judged in the Dwarvish Tongue
This is obviously a pretty foolish thing for Bilbo to have agreed to, but then Bilbo had been a bit overwhelmed (and hung up on the "evisceration" and "incineration" clauses)
1 That individual races had their own, purely internal, legal systems is unquestionable; I'm primarily interested in the question of how inter-racial disputes are resolved