LED's Digital outputs

Yes, you can, as long as you have a current limiting resistor in one of the legs. As you note, that is one way to multiplex an LED matrix.