Not really a law except maybe the law of survival.
In the Spring, male gators can leave their lakes/ponds and go out looking to get lucky so they can end up in your house/garage/backyard, pool, wherever except maybe your attic.
Keep an eye out for a gator and if it “attacked” you on your property its fair game and the tail is good eating.
They are not endangered, they’re a menace near any body of water in Florida. I do wonder what an alligator egg omelet would taste like. ;-)
Forgot: Don’t go walking around close to Florida lakes/pond even at a hotel with or without “FiFi”.
Strangely, my wife (a Tampa native) and friends would float down the Hillsborough river (a good sized river) in innertubes with gators sunning themselves on the banks.
Crazy in my book. Circa 1969-72.