How to use database users as a foreign key field in any table I want to create a table where I can have a column username which will be the foreign key and it will only contain usernames of existing users on that database. For example, if I want to insert 'John' in that field, there have to be a database user 'John' otherwise database should throw error. Any help?
You cannot create a foreign key that references an Oracle data dictionary table.  So assuming the "users on that database" are Oracle database users that exist in dba_users, you can't reference dba_users in your constraint.

You can, however, create your own copy of the dba_users table and create a job (using dbms_scheduler or dbms_job or some external scheduler) that will periodically copy the data from dba_users to your copy of the table.  You can then create a primary key constraint on the username column in your copy and create a foreign key constraint that references your copy of the table.  You may need to work with the DBA team to ensure that your copy of the table gets refreshed as part of any process that creates new database users depending on how soon after a user is created you would expect rows to be created in the child table.