Heroku has no influence on back-end services.
It's just a way to host your Java / Spring application.
For the mobile application, what matters is the routes of services provided by the backend.
If you have a domain of your own, you can set it up wherever you want (including Heroku) and then call the services from there.
That way, it does not matter if you use Heroku or a server of your own. The important thing is that the routes that the mobile application requests are correct.
For example:
If you have the domain meudominio.com.br
and you have a back-end user registry service, your mobile application would call a route as:
https://www.meudominio.com.br/usuarios
This is independent if the backend is in Heroku or local, as long as your choice is set correctly.
However, you do not need a private domain, but in that case, the route would change depending on the hosting you choose: Heroku will have to provide something like nome-da-sua-app.herokuapp.com
, the location would be an IP, Amazon would have another way on.
Of course, it is much easier for you to upload a Spring Boot application and configure the domain for Heroku than if you want to do it on your own server (unless you have knowledge below).