The recipe for egg bread calls for 2 eggs and 2 yolks. What would result from just using 4 whole eggs?
Let's put it this way - you can, but there will be consequences, so you probably shouldn't.
Bread dough that behaves like you expect it to depends on a given amount of liquid for a given amount of flour. Using whole eggs instead of just the yolks called for increases the liquid, so you'll have a runnier dough while its raw, making it harder to knead, so then you're tempted to add more flour and everything gets out of whack.
In bread making, an egg is a liquid. One egg yolk is about 20 grams of liquid. One egg white is about 40 grams.
So four eggs are 460=240 grams or milliliters (a bit more than a cup of liquid), while two eggs and two yolks are 260=120 grams plus 2*20=40 grams for 160 grams of liquid (a bit less than 3/4 of a cup).
So what to do with the leftover egg white? There were good suggestions here already, but I like to either freeze it for later use, or stir it with something flavorful (anchovy, parmesan, garlic, and then fry it up and eat it now or chopped in a salad later :)
I love how Lisa started her answer - you can, but there will be consequences.
I am not sure there will be that much problem with the hydration. Additional egg whites don't make dough as liquid as water or milk does, and 40 g extra egg whites are probably not going to do that much to the dough consistency, if you are not working with tiny amounts of flour. And the dough consistency doesn't matter that much anyway - there are many breads which handle terrible as doughs, but are formulated to produce a great final texture, so a slightly runnier dough shouldn't be a problem.
What will change most is the final texture. It will be more tender, crisp and dry. It will also be crumbly compared to the original, but that's a relative thing, you shouldn't expect it to fall apart when cut. You won't get that moist softness which comes from high-yolk dough, it won't have the silky smooth mouthfeel intended by the original recipe. And the taste will be different, with less of an eggy flavor. So, you will generally be making a different type of bread - it is up to you if you want it that way or not.
As you can probably tell, 2 whole eggs consists more liquid than just 2 egg yolks. Many sources recommend replacing 3 eggs yolks for 2 whole eggs, while many other sources recommend replacing 2 egg yolks for one whole egg.
Since the recipe calls for 2 egg yolks, it would, of course, be more convenient to use the 2 egg-yolks to one whole egg ratio. But since there is about 5 grams of fat in every egg yolk, or one teaspoon of oil, I recommend the best substitute for 2 egg yolks would be one whole egg + one teaspoon of oil.