When you say usually "localhost, but sometimes not" is there an absolute way to refer to the localhost maybe something I could find via phpMyAdmin?
When logged into phpmyadmin you will see the database server name (i think that cpanel is normally localhost, if not you need to ask the hosting admin).
Would I need to create a table in the database or its not important ie Table prefix?
The install will create all the needed tables in the databse you specified in the connection string (localhost is the server, database name would be the name of the db).
The Collation in modx defaults to utf8_general_ci, I’ve set the Collation to this in phpMyAdmin.
Sounds good. Remember to use the databsename and username the way that they show up in cpanel (with the prefix: dex_ in your case) cpanel will automatically add the account prefix to the databases and users.
I almost forgot, also in cpanel you need to assign the user to the database. So the steps would be to 1) create database, 2) create user for the database, and 3) assign user to database. And dont forget the prefixes.