The horse is likely to be real.
1. Checkhov's gun
Chekhov's gun is a dramatic principle that states that every element in a story must be necessary, and irrelevant elements should be removed; elements should not appear to make "false promises" by never coming into play.
If the horse was a hallucination, then it should have been addressed as a hallucination at some point in the plot. It wasn't.
2. Some horses do live in the desert
The Namib Desert Horse is a rare feral horse found in the Namib Desert of Namibia, Africa. Despite the harsh environment in which they live, the horses are generally in good condition, except during times of extreme drought. The horses have been the subject of several population studies, which have given significant insight into their population dynamics and ability to survive in desert conditions.
This is about African horses, but the same appears to be true for Arabia:
The proto-Arabian horse may have been domesticated by the people of the Arabian peninsula known today as the Bedouin, some time after they learned to use the camel, approximately 4,000–5,000 years ago. One theory is that this development occurred in the Nejd plateau in central Arabia.
it is unlikely for a horse to walk around in the desert.
Given that horses live in the desert, it's not that unlikely.
I am wondering if this horse a real horse or it is imaginary and carries a message?
It's both. The horse is real, but it still carries a message.
A horse is a peaceful, kind animal, which is in stark contrast with the war zone and military mentality that the main character has been living by.
The main character is put into a situation of mistrust. When they come across locals, they are suspicious of them. Are they civilians, or maybe insurgents in disguise?
Again, the horse creates a sharp contrast here: amidst all the chaos, it still approaches the main character calmly, trusting that he won't be harmed.
The interaction with the horse reminds the main character that peace and trust still exist, even if not in his current environment (in the middle of a war). It grounds him in reality.