There's a classic book called "art and science of analog circuit design" and there's a whole chapter on scope inputs.
The TLDR is at the input you limit lightning / hand of god level of voltages using the usual RF techniques for lightning protection, so you never have to protect against more than a couple hundred volts, then implement a ridiculously high impedance / voltage attenuator such that it'll arc over before the output exceeds a volt or so, then you limit the output with (optimistically) low capacitance diodes to the power supply. Then a buffer that converts from high impedance in to low output impedance and from there on its pretty boring analog stuff, gain stages etc.
Or the TLDR of the TLDR is you have multiple protection stages and (controllably) attenuate the heck out of the input signal. Also you rely on some ohms law tricks... a voltage big enough to damage in series with a ridiculous resistance will be a very low current which any protection diodes can survive.
Its a tricky business to work around all the RC time constants that occasionally are not fun at all.
Three things to think about. Everyone uses 10x 100x 1000x scope probes, so when you sniff 460V VFD power you're probably using a 100x probe and only measuring 5 volts or so. Also protection circuits tend to protect against the usual 60hz and DC overvoltages... shoving the output of a MRI amplifier at hundreds of MHz will just arc across and blow it to bits. Finally its possible to build RF front ends that sniff RF down to thermal noise limits, and scopes throw all that away to survive hundred volt transients on the input; I assure you ultra low noise microwave preamps will not survive more than a couple volts input, but those are bazzilionths of a picowatt not mV range.
Oh and a warning... you pick up a 100x scope probe, your scope handles up to 500 V input (perhaps) so you think you're good to 50000 volts in, but the probe has its own input voltage limit and unless you have bottomless pockets it probably tops out around 2.5 KV, so if you try to measure a 35 KV flyback transformer for an old fashioned CRT using that 2.5 KV probe, kaboom...