Can analog pins be used as a digital output pin?

Yes, you can use the analog pins as digital pins D14 through D19.

Digital pins 0 and 1 can be used as digital pins however these pins are used for serial communication to the PC over USB, including downloading sketches from the PC to the Arduino. So if you connect physical devices to pins 0 and 1, they may interfere with the downloading process.

--
The QuadRAM shield: add 512 kilobytes of external RAM to your Arduino Mega/Mega2560