Yes, the connection is made via the server connection and not via the local network. The Amazon account in connection with the Alexa-enabled device can be seen as an app that you can use anywhere.
For example, if you log in to an Alexa enabled device at your vacation spot, and give commands, they will be executed at home. Even if you take your Echo with you on vacation and give commands, they will be executed at home.