Can I use glue instead of nails to install shoe molding?
Shoe molding may have to be removed in the future to work on the floor or the wall. That's fairly easy with nails. It's fairly difficult with glue, unless you use something like hide glue that's specifically intended to allow disassembly ... and the techniques used for that would be hard to apply in situ to parts of a house.

Generally, don't glue anything that may need to be serviced, unless you're willing to risk having to destroy it to remove it.