No, it is not mandatory for you to take PTE Academic in your home country. You can take PTE Academic from the test centres around the world. Make sure you check what type of ID you have to use. Refer to the Acceptable ID policy for PTE. If you are outside your home country, you will probably be asked to show your passport at the test centre. You will also need a valid visa to appear for the test.