If a person submits testimony to a count in writing, this is most often done via an affidavit, which is generally sworn or affirmed to be the truth before a notary, magistrate, or other official. It can also, in some cases be done by signing a document which includes the words "under penalty of perjury" or some similar phrase, particularly if there is a law requiring such a document to be truthful.
If such written testimony or document is false in a material way, the country in which it was submitted to a court can, if it chooses to, prosecute this as perjury. (It may also be a contempt of court.) There would the the problem of enforcing any criminal judgement, which is always present when a person is charged with a crime by a country where the accused is not present. One possibility is to have the accused extradited from the country where the accused is present. This requires the cooperation of the source country, often via a treaty. Another possibility in some countries is to try the accused in absentia, and then arrest or extradite the accused later, if it becomes possible. This is more likely to be done if the country that wants to prosecute cannot obtain the accused's extradition.
In addition, when a person falsely swears to or affirms under penalty of per4jury a document, knowing that it will be sent to a court, or used for legal purposes, in another country, that person probably commits perjury in the country where the document was sworn to or affirmed, depending on that country's laws. That country could choose to prosecute the person locally, rather than extraditing the person.
Generally perjury must be over a serious issue, or neither county will choose to prosecute. It can be hard to prove. But that says nothing about which country has the right to prosecute, only about whether those rights will be acted on.