Elastic database queries you will have it available on Azure SQL Database as a way to perform cross-database queries with Azure SQL Databases only, you cannot get databases managed by SQL Server instances involve in elastic queries. On SQL Server VM (Azure and on-premises) you can perform cross database queries as usual, and you can get Azure SQL databases involved by using linked servers to Azure SQL database.
You will be able to perform cross database queries on the Azure SQL VM that involve the other database migrated to Azure SQL by creating linked server to Azure SQL. However, you won't be able to perform elastic queries on Azure SQL with the databases you will have on the Azure SQL VM.