Technically it will work but it’s not advised. When the Core starts up those pins will be floating inputs. Additionally as outputs the pins can only sink and source a few milliamps, so I really wouldn’t do it!
They might float at first, but setup() always runs before you user code loop() does, so you can put all of the pins in the correct state before any code is interpreting them without a problem. It should be fine.
Which is about enough to run a single LED. It really isn't good practice to try and power a device from the I/O pins. Personally I wouldn't risk my Core.
I'd say @Timb and @BDub have both their points, but the answer is neither yes nor no in general
It all depends on what you want to source/sink with that I/O pin.
As for the example @dermotos mentioned (button to GND) that's perfectly OK e.g. when having the other side of the button connected to an INPUT_PULLUP pin or otherwise (not prefered) having the switch between a HIGH OUTPUT pin and an INPUT_PULLDOWN pin (since the input pin is high impedance anyway and the pullup/pulldown are too big to draw too much current).
But I would not drive a LED without current limiting serial resistor.
So it all depends on what current you'd expect to source/sink - that might be why @david_s5 asked for the schematic @dermotos was thinking of
I have two buttons and two, two-axis pots. So rather than have the GND split into 4 (I’m using jumper wires, not enough space for a protoboard) I thought I could use some of the unused digital pins as GND’s for the buttons. I’m not driving anything from these. From the answers (and my experience) its seems like its ok. thanks!