This soldier was an ordinary man, not a ruler nor leader of anything. It shows how God can speak to ordinary people through dreams. There are also loads of present day examples of God speaking to people through dreams. The problem is that we do not always recognize it. Of course God also speaks to committed Christians or God fearing people by dreams.
Dreams can come from the demonic world.
Dreams are visions that we have when sleeping. He is a master deceiver and often pretends to be an angel of light. Even when we are walking in the light of God's word demonic forces can still attempt to attack us through our dreams. We need to pray against these attacks of satan. Simply insert your own values between the double-quotes.