Can a similar definition be applied in PostgreSQL for User and Database name mapping, i.e if a database name is same as a user name then the access privileges for that database are guided by the properties defined for that user in view pg_roles?
Nowhere in "pg_roles" does the name of a specific database appear - so no.
So while creating a database of the same name of as a user "just works" it is working because of a default that can be changed. The fact that the names match doesn't enter into it.
Right, the database does not appear in pg_roles. So having a database name same as a user in pg_roles, does not have anything to do with guiding the access privilege for the database.
It seems that for convenience, the OS username and the DB name correspondence could be in place.
Many other PostgreSQL utilities like createdb, clusterdb, vacuumdb, reindexdb, pg_dump assume the dbname same as username, in case it is neither explicitly specified as an option nor it is set in the environment variable PGDATABASE.