CASR 202.279 or thereabouts discusses it. You can do it provided the sim, training centre and the examiner are all approved by a recognised foreign state. See the start of Part 61 for that list. Be careful wrt the examiner, even if they hold an EASA approval they must be licensed by a rfs, not all EASA countries are rfs. Must complete the oral component with a CASA approved examiner or CASA FOI who has to get the flight test number as well