It's not against the law and it's not controlled by the Mafia. There are a lot of restrictions, such as you can't be near an archaeological site, church or natural park. This makes Sicily a little difficult as people have been here for 3000 years, everywhere is one of these sites. WWII sites can be a little treacherous due to unexploded ordnance. There are open areas where you can, these are usually the same areas the sheep herders use for grazing. The beach is open unless it's a natural reserve. There are quite a few facebook groups for metal detecting in Italy. The owner of the coffee shop across the street from my apartment goes every once in a while. There are laws regarding historical artifacts, some in the governments favor but some that protect private collectors as well.