The word "law" refers to the rules and regulations stipulated by a governing body and followed by a community. The word "justice" means the carrying out, or administration, of those rules on an equitable basis. Sometimes people tend to use the words interchangeably. In The Merchant of Venice, specifically Act IV, Shylock adds another word, "bond," that can mean "contract," but he also seems to use it as if meaning "law" and "justice," depending on the written context. These words are thus best examined in context as well.
First, Shylock continually says, "I would have my bond" (IV.i.86). He is explicitly saying that he wants the contract between Antonio and him to be acknowledged by the court as well as executed. In a way he is saying, "I want justice." Justice is satisfied when supported by the law and upheld by the judgment of the court. Therefore, "law" and "justice" have an interdependent relationship--without one, the other cannot exist. Shylock points this out by saying the following to the Duke:
"To have the due and forfeit of my bond.
If you deny it, let the danger light
Upon your charter and your city's freedom" (IV.1.36-38).
Here he is saying that if they don't uphold the law, their city's integrity is threatened.
Then, when Portia (disguised as a lawyer) gets involved, she and Shylock toss "law" and "justice" around more frequently. Shylock refuses to negotiate the stipulation of the contract mercifully and demands justice by the letter of the law being carried out; which is to say, he wants the law to be supported by a judgment of the court. Portia then says the following:
"Thyself shalt see the act;
For as thou urgest justice, be assured
Thou shalt have justice more than thou desir'st" (IV.i.310-312).
She warns him that justice can be satisfied in more ways than one. Once judgment is passed, the law is locked in and justice is satisfied. The end. There's no going back after this point, so Portia gives Shylock every chance to show mercy beforehand. Fortunately for Antonio, Portia has other laws that must be administered in order to satisfy justice if another law is broken--the one saying that anyone who seeks the life of a citizen of Venice shall have his estate seized. And the consequences of Shylock's demand for justice topple over him like dominoes after that.