There is no direct way to do this.
You ideal solution should use different sub sites for country and different folder for each company. Create groups like India_CompanyA and India_CompanyB etc. Break Document library permission and provide permission to group accordingly.
If you still need to use single document library. You would need to use item level permission and create groups for each country like mentioned above, and provide permission to group at folder level.
So at high level do the following.
- Create all required groups according to Country and Company, ideally
you will have number of groups equal to number of companies across
- Create folders in document library accordingly with Country at root
level and sub folders for each company inside country folder.
- Break permissions of each folder by stop inheriting permission and
applying folder level permission to group.
You can follow this link for changing permission for folder
Side note - If your documents inside are going to be more than 5000 items, you should avoid item level permission (though you are applying permission at folder level)