That is one of the convention's purposes, but there are more, such as the problem of travelling across various borders while a crime is committed.
If the person who came on board was not a passenger, then the situation is somewhat different. As I mentioned, the local laws in the state where you were parked at the time apply so he may have been within his rights to refrain from wearing a mask. I'm guessing here, but situations such as these can most likely only be sorted out if your airline has agreements in place between them and the handling agency and airport at that location. In the interest of avoiding further infections etc. the company can stipulate that all persons who have to enter the aircraft while parked wear masks, but this needs to be agreed between the companies involved. The argument that the state of registration's laws apply can't help you I'm afraid. If that were the case, you could park your aircraft on the airport in say Dubai and do all sorts of things inside that aircraft that Dubai's laws don't permit. Do not expect a local judge to accept that argument!