I would rely more on the pau d' arco than the peroxide. And keep in mind that you are not going to kill all of the bacteria in the mouth, so peroxide is not necessarily going to prevent an infection. This is another reason I would go with the pau d' arco since this will work an an internal Antibiotic as well.
Rinsing the mouth with water afterward is a good idea to help remove the acid stabilizers. The foaming is from the breakdown of the peroxide in to water and oxygen as well as the killing of bacteria.
Even if the dentist sprays the mouth with peroxide the dentist will still want to give you Antibiotics .