Is it safe and recommended way to store user-created valuable data (a single-file database) in an app container? Or should I better store it in Home/Documents/?
Related question: Are Mac Sandboxed app containers backed up by Time Machine by default?
If the data is in the form of a document, then the user can decide that themselves, as you have read/write access to any folder chosen by the user via a save dialog.
However if it's data that your app uses "behind the scenes" then store it in the Application Support folder (see NSApplicationSupportDirectory here), which happens to be deep within the sandbox container folder. In this you have no choice anyway, as without explicit permission from the user (which is given by using a save dialog), your app cannot write anywhere else.