No, the Danube River does not flow through Bosnia and Herzegovina.
The Danube forms a major section of the Croatia–Serbia border, passing approximately 20 kilometers (12 miles) from Bosnia and Herzegovina's northernmost point near the village of Rača. However, the river never enters Bosnian territory.
The country's hydrology is defined by rivers that drain primarily into the Adriatic Sea (via the Neretva basin) and the Danube basin (via the Sava, a major Danube tributary):
Bosnia and Herzegovina is a Danube Basin country—over 75% of its territory drains into the Danube via the Sava—but the Danube mainstem itself remains just outside its borders. The country is a member of the International Commission for the Protection of the Danube River (ICPDR) precisely because of this basin-level connection.