It is technically not legal to contract with someone to repay what was stolen in order to avoid prosecution; and in any event, if the matter was already brought to the authorities' (e.g. the police or prosecutor) attention, then the authorities may go ahead with a prosecution no matter what the victim of the crime wants--the state (the prosecutor) is in charge of the legal action, not the victim; and the fact that there was repayment doesn't mean that a crime did not happen in the first place.If the matter has not been brought to the attention of the authorities, then the person whose goods were taken may choose to consider this a mistake or misunderstanding if repaid and not bring it to the police in the first place; but that is not a contract to avoid prosecution, which that person cannot enter into. It is an agreement to repay damage or loss of goods/property which turns what might have been a crime, if there had been criminal intention (i.e. an intention to deprive the victim of his property), into a mistake, accident, or misunderstanding.