There are two reasons for the megaohm resistor.
One is ESD, to allow charges to equalize slowly instead of in a quick sparking zap. The other is human safety in case you touch energized mains or another energetic power source, either through a careless oversight on your part of through a malfunctioning power supply or something like that.
As far as whether to ground through a scope, a power supply, another instrument, directly to the mains ground, or directly to a cold water pipe, any of the above will work, as long as the integrity of the path is good. Some of those choices make it a bit harder to verify the integrity of the ground path.
Actually, as far as ESD is concerned, it doesn't matter much whether you're at ground potential or at some other potential, even kilovolts away from ground. What's important is that you and all the pins of every device you touch are always equalized at the same potential. Getting everything to ground is the simplest way to do this.