Nanoflows are designed with offline-first applications in mind, as they allow you to model application logic that works in offline apps.
Therefore it is recommended to use nanoflows where no connection is needed .
Yes indeed you can perform a retrieve from database in the nanoflow but it will not be as per best practice suggested by Mendix and also will generate a database connection similar to microflow.
In these scenarios I would suggest to think about below questions:
1) Do you want the local In-memory objects and do not want to perform following actions :
2.If you need the database objects and want to commit the change then you can go for Microflows.
3. If you need to have a nanoflow for some custom page action and also a retrieve or any action with database , try to combine such activity in sub-microflow called from a nanoflow on logic need basis as per best practice .
For use case and impact on usage of different flows , you can try to see the below document as well.
If you want to retrieve data from the database use the microflow retrieve. As nanoflows run in the client thus you would need to call a microflow in a nanoflow to retrieve data from the database.