As strange and as disgusting as it may seem, they ate it. Most Bible scholars have done their best to make the dove's dung something else. However, there are other records of people collecting and eating dung in times of terrible famine. The head of the ass, or donkey, was not much better. It was one of the unclean animals for Jews and the head of a donkey is its most inedible part. These examples are given to show the extremity of the famine. They were reduced to eating disgusting food for outrageous prices. But that is what people do when they are starving to death.
This verse is followed by the story of two mothers who agreed to eat their babies. However, the first mother complained to the king when the second mother hid her baby on the second day (2 Kings 6:26-30). Certainly, this story is no less awful than the eating of ass's heads and dove's dung. The purpose is to show just how desperate people get and how far down they will go when they have no food. It also shows just how bad this famine was. There is no reason at all to doubt the plain meaning of the passage.