When I took my OW, we were taught to donate our octo. We were also taught that our buddy would calmly and rationally realize he was out of air, gently swim up to us, signal this fact, and wait for us to search within the golden triangle for the octo we hadn't paid attention to since the beginning of the dive. Realistically, if your buddy is OOG, he's going to be reaching for whatever source of air he can get. If you don't shove a reg in his face, he's quite likely to take the only one he can see; the one in your mouth. Giving him the reg that I know where is and can get to fastest solves that problem and gives me a full, calmer lungful of air to deploy my secondary air source for myself. Technical divers, from whom rec divers have borrowed this, have an additional reason for donating the reg that they're breathing; stages. They may be carrying multiple different gas mixtures, some of which are helpful at some depths but deadly at others. By donating the reg that's in their mouth, they donate a reg that they know is working and that they know is giving the right gas. In a Hog configuration, they then just tuck their chin to get their secondary reg; much less room for it to roam there on a short hose than on a 40" hose on the chest.
That's both schools of thought in a nutshell; make your own choice as to what's better. Personally I donate whatever reg I'm breathing off of at the moment, then sort things out when we get the situation calmed down.