No single action is illegal, it's the context of the action that is illegal.
For example, "killing" you may think is illegal, but it's not. Your kingdom could be at war with another kingdom, but all the soldiers don't get arrested if they kill people. However if you put killing in the context of "murder" then sure thats going to be illegal... but both actions are the same, as well as the end result.
Your specific examples are both legal as well, because base on what you have put....
Example 1: You are a shopkeeper and receive some new supplies but the lock didn't come with a key. You have your friend pick the lock for you.
Locksmith is a job, it's a job in the real world just like it's likely to be in Elyria. If you get locked out of your home, out of your car, out of wherever, you call a Locksmith. Being a locksmith isn't illegal.
Breaking into someone elses property though, thats illegal. If your dealing in stolen good thats illegal, but opening up your own belongings because a key is lost, thats not illegal.
To put it in a bit more context.... for the action to be considered a criminal act, someone needs to report their property missing, or that it's been broken into. Since you are the owner, why would you report yourself for breaking into your own property?
Example 2: You are going to have a duel with someone. Perhaps in an arena or maybe just somewhere else in view of others.
For having a duel in public, depending on the laws of the land, that might be illegal, but the duel itself isn't illegal so long as everyone involved consents to the duel. Same as the above, so long as you agree, why would you report yourself?
If it was an arena, that'll be a purpose built location for such an event. Likewise if you were a woodcutter, you would go to a forest that you can legally cut wood in, you wouldn't go to the town square and cut down the tree in the middle of the market.#
Anything can be legal or illegal, it just depend on the how and why of whats happening