I am currently in the US on work visa (H1B) and have been contributing to a HSA account. If I leave the country at a future point of time, what happens to this account and would it be possible for me to utilize the funds in the account for eligible medical expenses even if they are overseas?
HSA may be used for reimbursement of qualified medical expenses outside the USA, however the problem you are going to face is that having an HSA at all requires you to have a resident status in the US. If you relocate permanently outside the US, you lose that status.
You may get away with it, but in my opinion the best option is to cash out your HSA and pay the taxes and penalties before you leave, otherwise you risk losing the money all together or having it tied up in limbo for a period of time.