I was told that in Afghanistan there are two major languages Pashto and Dari, and when you live in Afghanistan you will find that almost all the Afghanistanis could speak Dari and fewer people could speak Pashto. And I was also told that Persian and Dari belong to the same language group and share many similarites. So can I travel around Afghanistan with only speaking Persian? Can everybody understand Dari/Persian in Afghanistan?
Dari is Persian as spoken in Afghanistan. The difference between Afghan Persian and Iranian Persian is about as great as that between British English and American English. They sound a bit different, but they are basically the same. Most Afghans (though perhaps not all) do understand Dari/Persian, even in the Pashto speaking areas.
It depends on the area they come from.
There are many Persian phrases which Dari speakers struggle to understand e.g name of fruits or terms which exist in Iranian Persian only.
There are also terms which refer to different things in both languages. For example, Iranians use the word 'madreseh' for school which Afghans use the word 'maktab' when referring to modern schools and madreseh could mean a traditional religious school in Afghanistan while in Iran maktab refers to the old religious schools which are now obsolete.
I have many Afghan friends and I can confidently say they more or less understand Persian but the ones whose mother tongue is Pashto struggle a bit especially if they haven't studied Persian at schools.