You wouldn't normally say on a bus; on the bus is a fixed expression.
The reason why the is used in that phrase is probably because the bus here is something we all know about, something that by extension refers to the institution that represents the (public) transport bus service that uses buses to drive people around the city. The phrase doesn't refer to any bus in particular per se.
In his book, Practical English Usage (69.5), M. Swan says the following:
We use the (with a singular countable noun) when we talk about some kinds of thing that are part of everybody's lives, like ‘the bus’ or ‘the hairdresser’. In this case the bus, for example, does not mean ‘one bus that you know about’; we use the to suggest that taking a bus is a common experience that we all share.
To address the comment and some additional questions one might have after reading the above:
I merely wanted to answer the question of whether on the bus is grammatical in that context, and how that's accomplished – not suggest that on a bus isn't. It would be more usual, given the context the asker provided, for their friend to say I'm on the bus and not I'm on a bus.
I'm on the bus might mean "I'm on the bus I tell you I'm on every day – my school bus", i.e., "...the bus you expect me to be on at this time". It could also mean "I'm on the bus we previously discussed". Et cetera.
Can you say on a bus? Yes, you can say, for example,
I can't talk to you right now, I'm on a bus.
As you said, this introduces a bus; you're talking about it for the first time and identifying the vehicle as a bus.
Last week he was on a bus when an argument erupted between... (independent.co.uk).
He was on a bus – it doesn't matter what bus. The same applies in the example that follows:
"It doesn't. Why would it? I'm nobody." She lowered her chin as her face twisted up. "Just a girl you met on a bus." (Don't Move by Dennis Etchison)
https://ell.stackexchange.com/questions/136321/on-a-bus-or-on-the-bus