When measuring ripple voltage, generally polarity does not affect the result, since ripple has the same amplitude regardless of polarity. So logically, it doesn't matter, but that is not the whole story.
From a practical standpoint, it is possible for Bad Things to happen when you do not carefully think through where you attach the oscilloscope ground. The underlying reason for all of the bad things that can happen is that the oscilloscope probe ground is also connected to earth ground by way of the oscilloscope power outlet. This also means that all the channels on the oscilloscope have their grounds connected to each other inside the oscilloscope.
If any part of the circuit you are testing is connected to earth ground, then that is where you must connect your oscilloscope probe ground. Don't connect it anywhere else. In theory, you could have an AC to DC converter whose negative output terminal is earth grounded inside the supply. If so, it would be a complete disaster to connect oscilloscope ground to the positive terminal of the power supply. You would be shorting the power supply through your oscilloscope ground wire.
Sometimes the connection can be much more sneaky. For example, maybe you are using a battery powered device. So in theory you can connect oscilloscope ground anywhere, right? But what if the device also has a USB cable connected to a desktop computer? Maybe the USB shield is earth grounded. So once again, you have created a short circuit through the oscilloscope ground probe. Same applies to audio jacks, programming headers, etc. They MIGHT be connected to earth ground via your computer, even if the device you are testing is battery powered.
So, in general, connect the oscilloscope ground probe to ground. Any time you deviate from this practice, you need to very carefully think it through. Is there any possible way something else could be grounded? If so, don't do it.
Please note that isolated differential probes are available which can allow you to connect either input (negative or positive) to any point in the device under test. Of course, there are limits to how much isolation these can provide. But they can be very useful if you are dealing with H-bridges or class D audio, etc. There are also high-speed differential probes with high bandwidth for looking at high speed digital signals which are differential. These are usually not designed to provide a lot of isolation. Don't use them anywhere near a high power circuit if you can help it. They are for USB and DDR and such.