It's possible to do from MS SQL Server. You can configured a Linked server which will allow you to execute queries from the MS SQL Server to databases on the MySQL server. I believe that in this case the SQL Server is not executing the query; it's just acting as a client and passing the query to the MySQL server. So you'd have to use MySQL queries to manipulate the remote database. In my experience what I've done is just configured a linked server and then created views on the MS SQL Server for the queries I plan to pull from on the remote server. Then I can manipulate the data from the views as if it was from MS SQL Server.
MySQL has limited options with the FEDERATED engine, but can only access MySQL databases remotely.
However, in a general sense, just because two RDBMSs use SQL doesn't mean they're compatible. All RDBMSs use slightly different dialects of SQL and implement ANSI SQL in ways that aren't always consistent. MySQL especially is notorious for being different.
This is why you'll see software packages specify specific RDBMSs as being supported (sometimes only one). Additionally, each RDBMS handles the tasks of creating databases, configuring server settings, configuring replication, backup, etc. in entirely different and incompatible manners. Adding a user account to MySQL and MS SQL are entirely different processes in spite of the fact that the task goals are the same.