Local prepaid sim cards that you buy in a store on arrival on your holiday destination are in general only valid in the country you buy it. But so called international sim cards and e-sim cards you buy on the internet can be used in multiple countries.