Actually I have some sites where the database is hosted on a different server than the domain. There’s no issues at all with it, except to have the correct server info in the config file.
$database_type = 'mysql';
$database_server = 'mysql.host.com';
$database_user = 'username';
$database_password = 'password';
$database_connection_charset = 'utf8';
$dbase = '`database`';
$table_prefix = 'modx_';
In the example config file above, the separate database server is a "feature" of the hosting provider, so access is not a problem.
A possible issue with such a setup is that the database may be configured to only allow localhost access (this is done when creating the users; their access location can be "from anywhere", or can be restricted to the localhost or some other host).
This one grants access to all tables on a database named somedb to someusr logging in from the localhost with a password of ’passwrd’:
grant all privileges on somedb.* to someusr@"localhost" identified by 'passwrd';
This one allows our someusr to log in to access all tables in all databases from anywhere:
grant all privileges on *.* to someusr@"%" identified by 'passwrd';