Oscilloscope and main earth reference
The ground of your oscilloscope will be connected to mains earth assuming you're using a socket that has an eart connection. For safety, it should have this !

If the mains adapter you're using to feed your arduino board has a main earth connection then the same will aply tho this adapter.

Most mains adapter however do not have a mains earth connection and these will be floating with respect to earth.

For both adapter cases it is safe to connect the arduino's ground to the scope's ground.

To safely measure mains voltage on a scope you need to use an isolated probe or measure through a transformer for isolation.

Some (battery operated) portable scopes have an isolated ground and this in combination with appropriate high voltage rated inputs is enough to measure mains directly. But most bench scopes are unsuited for this.

I also highly recommend this video by Dave from the EEVBLOG !