If you create a site using a ccTDL does your site have to comply with that country's law?
Short answer, that is not legal advice: the host country of the ccTLD certainly has jurisdiction. When you register a name you must agree to certain terms. Usually the terms include abiding by the country's laws and that is the least you could expect... But each extension is different. So the answer is that you should read the terms carefully and decide if they are acceptable to you.
Also check if the country in question has a good track record in terms of fairness or confiscates domains at whim. Some are more aggressive than others and their tolerance levels vary.
Some countries forbid adult or gambling, especially Muslim countries. Some countries have public lists of disallowed keywords (for example Israel). .us is also famous for banning the seven dirty words. Lots of countries reserve the right to dismiss vulgar names or anything contrary to 'public order'. If you register a name that is objectionable, then there is a risk that the registration will be challenged or revoked at some point.
In many countries, the registry has some discretionary power and may revoke names that are deemed to be offensive. In certain circumstances, they will make exceptional decisions. Apparently Spain recently seized a few Corona domains like covid19.es but 'temporarily'. If you don't like it, you can appeal or sue. But on their land, in their courts, not on your terms.
Some countries have privatized their extensions, known examples are .co (Colombia) or .me (Montenegro). That still does not mean they are unregulated. Generally they grant themselves some room for maneuver just in case.
Then you have some ccTLDs that don't seem to care much about what people are doing with their domains (think .tk) but some of those ccTLDs are unreliable and dysfunctional, some are actually on autopilot and have gone dark for extended periods of time (African ccTLDs in particular).
But as hinted in the comment above, you also have to abide by the laws of your country of residence, or whatever country your business is operating from. All those parties can hold you accountable for your actions.