It depends on what you want to do. The “basic” container just spawns and apache with ownCloud. You can use those variables to connect to a mysql instance anywhere (I don’t see a port, so I guees it will connect using the default mysql port).
If you’re using docker-compose and the “recommended” .yml file (https://raw.githubusercontent.com/owncloud-docker/server/master/docker-compose.yml), that file define both mysql and redis services which will also be spawned along with ownCloud. It’s also tailored to connect the 3 services together with a minimal information you need to provide, in particular, the connection to the DB is already setup to connect to the new spawned DB service.
You can modify that file at will (know what you’re doing), so you can remove the DB service, and connect to an external one.
Note that I don’t recommend to do this. It might be useful if you have a DB service running in another host