If you're talking about the power supply (the part you plug into the wall [the charger is a chip inside the phone]), as long as you have a cable that plugs into it with a microUSB plug on the other, yes.
Mixing chargers and phone is fine, the charger (if it's working right) won't damage the phone. The only problem would be using an older charger in a newer phone - it might not charge as fast as you're used to, because the charger isn't capable of fast charging as fast as the phone is able to be fast charged. (In this case, you have the opposite situation - the G7 charger can charge at QuickCharge 3.0 specs, but the phone can only charge at 2.0 specs, which the charger is capable of, so it will work just like a G6 charger. If you used a G6 charger to charge a G7 phone, the phone would charge slower.)