The answer depends on two bans for drivers, and they apply to a bus too. First: you may not open the doors while the vehicle is moving, because someone could fall out or step out while it's moving. Second: even when the bus is stopped, the doors may not be opened if this would get in the way of other road users, such as a cyclist or a vehicle going by. So both cases are correct at once