One man has died and 23 people have been taken to hospital after a bus overturned in the Scottish Borders.