You do not make a bracha on the smell of bread and you can enjoy the smell.
Explanation:
The Gemara in Brachot 43b says: Mar Zutra said one who smells an Etrog or a quince should say ‘Baruch Attah…Asher Natan Re’ach Tov BaPeirot-He who gave a nice smell to fruits.”
The Gemara in 53a says: Rav Huna said the spices of the bathroom (air freshener) and of oil which is made to take away the impurities we do not make a bracha on since if it is not made for scent, we do not make a bracha.
The Ros asks a contradiction between the two Gemaras. He answers that the Etrog was picked to smell it or to eat it and then smell it, but I the picked it to eat and then smelled it since he did not intend to smell it just happened, he needs not make a bracha.
Tosfot is unclear whether he agrees with the Rosh.
The Gra writes That Tosfot argues with the Rosh and they are of the opinion that something which is not in essence for smelling but for eating for example even if you took it to smell it, you cannot make a bracha on it(as the Damesek Eliezer explains and the Chazon Ish.)
The Biur Halacha though (216)writes that it makes no sense to say that Tosfot argues with the Rosh since other Rishonim quote Tosfot as agreeing with the Rosh. Everyone agrees if you take the fruit to smell it, then you definitely make a bracha on the smell. The disagree when he took it to eat and you smell it. The Rosh says you should make a bracha and Tosfot says you don’t’.
To review the Gra and the Biur Halacha argue what Tosfot’s opinion is. The Gra writes that Tosfot holds you never make a bracha on something which is made for another purpose rather than sniffing t.
The Biur Halacha says that they only argue when a person smells it by accident Tosfot says you can make a bracha if you take it to smell.
The Bet Yosef (297) quotes many different Rishonim who discuss whether to say Borei Minei Besamim. The Rema also brings these opinions :some say one who smells hot bread he should say the bracha of Noten Re’ach Tov Bapat, and some say you don’t’, therefore don’t smell it.
Mishna Berura explains why not to: Since it is not a real important smell.
The Chazon Ish explains that that is Tosfot they the main thing is not for smelling.
The Chazon Ish understood that Tosfot argues not only about taking a fruit to smell but also by bread taking it to smell it. However, why by a fruit the Shulchan Aruch rules like the Rosh that you do say bracha. As he writes in 216:7: If the fruit is good for eating then say the bracha after smelling it,”Hanoten Re’ach Tov BaPairot. That is when you took the fruit with the intention of smelling it, but if you took it to eat but not to smell, even if it smells good you may not make the bracha.
In Seif 14 The Rema turns around a brings the argument without commenting on the Shulchan Aruch earlier.
The Biur Halacha though makes sense a according to this. The argument is about whether the smell is considered and integral part of the food or not. By fruit it is considered an integral part. But by bread it is a machloket. Therefore, the Rema says not to smell it.
So ruled R’ Ovadia Yosef. : Some says to smell a god smell on hot bread you say HaNoten Re’ach Tov BaPeriot and some say you don’t so we say the rule Safek Brachot Lehakel, in doubt don’t say the bracha.
However, if you are passing by a bakery you are not even taking bread in your hands, you are just smelling it there ore you can’t say a bracha and you stand there and enjoy the smell.