Yes, you can.
As long as you have an internet that allows you to file online, you can do so anywhere in the world. Please note that if you have a tax refund, that refund can only be directly deposited into a US bank located in the US. Otherwise, the refund can only be mailed to you as a check to the address ( including foreign address) entered on your tax return.
@reginaldyakupova