Creating tables is no different from executing any other query. That is, doing SELECT, INSERT, CREATE TABLE, ALTER TABLE etc is done the same way, and thus it doesn't matter if you execute these queries in phpmyadmin, MySQL CLI client or through your own php code.
However, the proper privileges must be set up, and a user may have privileges for SELECT only, or SELECT, INSERT, UPDATE, DELETE, but not CREATE.
So once wordpress can connect to the db with credentials for a user with create privs, the queries are executed and the tables created.