Hi @vijay ande , thanks for reaching out to us. Please refer below for more details.
1) For migrating from On-Premise to Azure Database for PostgreSql, you can utilize the 'Azure Database Migration Services' service. below article has step by step process of doing the same.
You can also achieve the same using Azure CLI, please refer below article which is very straight forward and if this is one time activity, you can prefer this approach too.
2) For migrating from Azure Database for PostgreSql to on-premise, there is no service or tool handy but below is the article you can refer to. Here we create a .sql dump file from Azure Postgresql database and then you can import the dump .sql file in your on-premise database.
You can also use the Azure Data Factory to achieve the desired functionality as well:
Please let us know if you have any query or looking for some more details.