Squirrels, rats and opossums love avocados as much as humans do. My brilliant neighbor is successfully protecting the fruits with paper bags held in place with clothes pins. She covers the fruits shortly before they get close to maturity. (Avocados do not ripen on the tree.) I am trying it as well. So far, so good. The neighbor reports the fruit has no problem ripening after picking, and tastes as good as if they had not been bagged.
Update March 4, 2022: Neighbor reports that at least critter figured out it could rip the bags off, but not all of them, because she was able to harvest some fruits for her family. Also a comment pointed out Opossums are not rodents, which I had grouped in with rats and squirrels, so I removed that.