Salam,
There are both Sunnis and Shi`ah in Afghanistan. I
think the Shi`ah in Afghanistan are mostly those
of the Hazara ethnic group.
It is important for Sunnis to respect the Prophet's
(s.a.w.) family, and of course, the Imams of Twelver
Shi`ism were all his descendents (through Fatima,
who was Ali's wife until her death).
Some Sunnis (particularly among some Sufi groups)
may interpret this as respecting the Imams of
Twelver Shi`ism as descendents of the Prophet
(s.a.w.).
For example, there is a recording of the Khalwati
(Halveti) tariqa in Turkey, who are Sunni,
performing dhikr (remembrance of Allah) on the
anniversary of the battle of Kerbala, where Husain,
the grandson of the Prophet (s.a.w.), was killed.
Husain is also considered by Twelver Shi`ah as
the 3rd Imam.
Jafar as-Sadiq is respected and praised by many
Sunni sources, and he is also considered by Twelver
Shi`ah as the 6th Imam.
However, I am not aware of Sunnis believing in the
12th Imam as the Twelver Shi`ah do. Sunni Islam
does believe in the coming of the Mahdi, but while
there are clues in the hadiths, the exact identity
of who the Mahdi will be is not known.
Without knowing more, I think it is impossible to
really know how your friend came to his belief.
Possibly he was influenced by Shi`ah family or
friends, that could be one possibility.
As for syncretic Sufi groups, the Bektashi are
sometimes considered to be such a group, but to my
knowledge they are not really known in Afghanistan.
They are known, to my knowledge, mainly in Albania
and Turkey.