It depends on the contract that your company submitted to USCIS. If it says your location is at a certain office, you better be working at that office. USCIS can sometimes drop in without notice and if you're not in that office, you can have H1B/visa issues. Or so I heard. That's why Walmart has not been open to remote work in the recent months. They've been closing that door slowly.
Yes and no, yes your H1B will remain valid, no you’re no longer in H1B status while not in the US. The time spent abroad will not count against your H1B so you can get that time back if/when you extend the H1B.