Possible to control two arduinos on differnt networks from one server?

So if I have two arduinos on separate networks (assuming they are both connected with an esp8266) is there any way to, for example, turn on an led from a webpage anywhere in the world? Could I give the arduino a "name" per se, that would allow that arduino to turn on the led. Could I log in to an account on a site that would allow me to only activate that named arduino, while my friend could log on to the same site with his arduino name and activate his? I hope that made sense. Thanks in advance

MQTT is probably the communications technology you are looking for. Your Arduinos and any computer with a MQTT client program can send messages to each other via a MQTT server. Have a play with that before thinking about the much more complex task of building a web site with login pages.

You can open up your home network router to allow anyone on the internet to communicate directly with your ESP8266's. Usually that's not done because you don't want anyone else turning your lights on and off. You would have to create some kind of login system and current best-practice security (SSH) won't fit on the limited memory of an Arduino. (I don't know about the ESP's - do they have SSH abilities?)

It's also rarely done because then there's no ".com" name for your web device. You need the IP address and, depending on how much you pay for your internet connection, that can change on a daily basis.

MQTT or something like it is going to be a better choice.