According to the web site it is based on actual events...
(Usually that means only the facts have been changed)
One night at a bar, an old friend tells director Ari Folman about a recurring nightmare in which he is chased by 26 vicious dogs. Every night, the same number of beasts. The two men conclude that there’s a connection to their Israeli Army mission in the first Lebanon War of the early eighties. Ari is surprised that he can’t remember a thing anymore about that period of his life. Intrigued by this riddle, he decides to meet and interview old friends and comrades around the world. He needs to discover the truth about that time and about himself. As Ari delves deeper and deeper into the mystery, his memory begins to creep up in surreal images …
Link to Official Site: http://waltzwithbashir.com/film.html