Running AS & NS in different machines

Can I run loraserver and app server in two different machines?

Yes you can, please see the configuration of LoRa App Server and LoRa Server for more information. You might also be interested in reading Network-servers (from the LoRa App Server docs).

can multiple AS use a common NS?

That is not supported (yet).