If you just want the NS records and glue for all the ccTLDs they're in the root zone.
https://www.internic.net/domain/root.zone
If you want the complete zone files from every ccTLD that is a much bigger ask. I'm not sure but I imagine you would have to look into each ccTLD and find out if they're available.
For ccTLDs there’s no centralised system and availability depends on the country registry. For example, Nominet make the UK zone file and others available for UK registrars for a fee I think.
Another approach is to buy WHOIS files from providers like Whoxy [1], the registrant data shouldn’t be used because of GDPR and other restrictions but as a domain list it can be useful.
I’ve done a fair bit in this area so if anyone wants any help feel free to send an email - details in profile.