At least at the Marriott hotels I stay at, they do not directly refill dispensers in the room, they swap out the bottles with new sealed bottles. I don't have any inside knowledge but my assumption is that the bottles are sanitised, refilled, and are then available to be added back to a room -- like towels, bed sheets and any other reusable product.
At least in the US, I do not believe this is the case with the current generation of products because the caps are not designed to be removed. When the bottles are empty, I believe they are simply discarded or recycled.