Is making guacamole a way to "save" almost-gone avocadoes?
First, you have to distinguish between food safety issues and other ways of food "going bad". The likely thing is that your avocadoes were safe to eat (= not full of pathogenous bacteria) on the day you threw them out. 

However, people cannot tell when food is full of bacteria, and tend to throw it out when it is too changed from its original state. Or they dislike the taste and texture of the changed state. This is common with fruit and vegetables. They are still alive after being picked, their metabolism goes on, but many of the necessary nutrients and water aren't delivered by the roots and stems any longer. So they change their color, taste and texture, and become mushy, wilted, or black,or change in other ways which people dislike, so they proclaim the produce "spoiled" and throw it away. 

If this is what happened to the avocadoes, there is a good chance that making it into guacamole would have let you enjoy the avocadoes a day later. A pureed avocado doesn't metabolize the way a whole avocado does, and the changed pH and other ion concentration (salt) changes the chemical reactions going on in the cells. It is now no longer a living fruit, but prepared food. The pH and cold storage also inhibit mold from growing, which can happen on ripe fruit held at room temperature. 

This is something specific to avocadoes and guacamole and not a generic statement about mixing random ingredients, you cannot make such generalizations in principle.