OpAmp impedance matching for multiple measurement devices
That's going to be some op-amp that will pass signals to 1GHz!

The 'impedances should be equal' idea is much misunderstood.

For high frequency signals, where you might use a 50 ohm cable between the box and the scope, you should set the scope input to 50 ohms. This matches the cable, and in theory will be sufficient for you to drive the cable using any impedance, from the zero or near zero of an op-amp, to any other higher impedance. Note that RF engineers frequently use a 1k resistor as a cheap microwave probe into a 50 ohm scope terminated 50 ohm cable. However, also making the drive impedance 50 ohm (by adding a nearly 50 ohm resistor to your amplifier) will improve the fidelity of the signal should there be any reflections from the scope's input impedance not being a good 50 ohms. It will also raise the impedance being driven by your amp from 50 ohms to 100 ohms, making it easier to drive.

The 1M ohm scope input is not expected to have any serious frequency response (that's what the 50 ohm input is there for), and no conceivable cable will match it. In this case, you can maximise your signal fidelity by driving a 50 ohm cable from a 50 ohm source impedance, this is known as 'series termination'. Although the scope will reflect all of the signal, the source impedance will re-absorb it all.

Putting the two conditions together, it can be seen that a 50 ohm output impedance on your drive amplifier, followed by a length of 50 ohm cable, will drive your scope satisfactorily whether it's switched to 1M or 50 ohms input impedance.

Most opamps have an output resistance around zero at low frequencies, but it often rises to many ohms as the amplifier runs out of gain. See the data sheet for your particular amplifier. Add a resistor of 50 ohms less the average output impedance over your frequency range of interest.