Patent laws vary from country to country. As such, a person can patent some item in country A and another person later on can patent the same thing in country B. As a result, most likely the person with the first patent would end up filing a legal action in country A against the person who did the later patent registration in country B.