Applications in linux store their user specific configuration in your Home folder. Applications that behave decently indeed do that in a dedicated hidden folder, i.e., a folder of which the name starts with a dot, so you normally do not see it.
You cannot as such change the location of such program folder unless the application exposes a setting through its options or through a configuration file.
One example of a very bad choice for a program folder which you cannot change is the "snap" folder, created by the Snap framework in recent Ubuntu versions. This folder stares right in front at you in your Home folder. As a user, you have to search nothing there, and with a name starting with a lowercase, the folder even stylistically is totally out of place. As a user, you do not have control on that folder.
So the same workaround suggested in the thread I mentionned can be used to hide a file on a location you find inconvenient: create a text file with the name
.hidden in the folder where the unwanted file/folder is, and include its name on a line.