A loaf of bread is discrete and countable, a bread bun is equally separate and distinguishable. These therefore are countable nouns.
There are exceptions, but bread itself *generally* is not countable as we do not consider it as a separate and distinct unit that can be counted. We imagine 'bread' as more a general description. As an example, think of the uncountable noun 'furniture'. 'Furniture' describes 'chairs', 'tables' that are separate and countable. 'Bread' is similar but with the component countable nouns being loaves, buns, etc)