A prompt, sincere, unqualified apology is the most portable social tool there is, and it defuses far more than travellers expect. The formula that works everywhere: apologise immediately, take responsibility without excuses, correct the behaviour visibly, and do not repeat the mistake. Excuses and defensiveness make things worse in every culture; the phrase I did not know, I am sorry, delivered with evident sincerity, makes things better in every culture.
Style varies, though. In face-saving cultures across East and Southeast Asia, apology is offered readily and often, sometimes with a slight bow, and accepting fault gracefully raises rather than lowers your standing; loud self-justification is the real offence. In more direct cultures, a brief apology plus fixing the problem matters more than elaborate words. In some traditions, a small gesture afterward, such as a treat for the office or a note to a host, completes the repair. Learning the local word for sorry pays for itself many times over.
If you unintentionally break an actual law or regulation, the calculus changes: stay calm and respectful, comply with officials, apologise, and pay any legitimate fine through official channels, asking for a receipt. For anything beyond a minor matter, contact your embassy or a local lawyer rather than negotiating your way deeper.