There's an Italian website where you can download Italian 3DS and DS ROMs, and every time you download one, a message box pops up saying that "by proceeding you declare to own the original cartridge and that you acknowledge that downloading a ROM of a game you don't own is illegal".
Is it like this in the rest of the world or is it just in Italy?
It could well just be something a website says. You will occasionally see it joked about around here and similar sites where old ROM sites had a disclaimer like "If you don't own it you agree to delete it within 48 hours" which has absolutely no basis in any legal system anywhere. I don't suggest following what Nintendo says (
https://www.nintendo.com/corp/legal.jsp ) and I also don't suggest relying on what a ROM site says here for the thing you tell any judge you might end up in front of.
Italy is part of the EU and thus part of EU law and what goes there, and even without that a lot of places will try to harmonise such things. It is not universal though as we quite often saw different countries make different rulings for flash carts and mod chips throughout the DS era. Wherever I look for any law they might use as a basis for this sort of thing I tend to find most laws are from the 80s and onwards when VCRs came to pass and it all kicked off, though computers did exist in the 80s no law maker really envisioned* what they since became (if they knew computers they would be doing something useful with their lives and all that) so a lot of it has had hasty extras added when new and exciting things came to pass, choice link at this point
https://torrentfreak.com/the-dawn-of-online-music-piracy-150620/ . In English there are phrases like format shifting (copying a record to tape to play in the car/walkman) and time shifting (recording a show to watch later), I have no idea what the equivalents in Italian would be.
*two big things that the laws had at the time of writing being that records and vhs tapes have a limited lifetime, cds and dvds do not, also record -> tape is inherently a lossy process where cd -> wave is not.
Most places will have some kind of part of the legal code that says you are allowed to make backups of software you own. Some ponder whether that means you personally have to rip the disc or whether you can download it but that could get complex. Equally it is usually the distribution that people get touchy about which is why torrents working the way they do (assuming you don't block uploads you are part and parcel of the distribution).
This personal use backup thing will often hang a lot off it, things like you have to take reasonable steps to make sure the software is not in use in two places (I can't rip a CD and then give the original to a mate while I enjoy the backup/rips), if you sell the original then any backups get to be destroyed or go with it.
If you have to bypass protection to do this then some laws, the US' DMCA for instance, might get in the way of that for the act of bypassing protections is in of itself a thing that troubles some.