Being pedantic for a moment, neither Afghanistan nor Iran are Arabic countries. The majority groups in both countries speak Indo-European languages.
I don't know whether the choice of solar vs lunar is connected with either ethnicity or with religious denomination (Sunni vs Shia) or is just random.
AH originated from Saudi Arabia and is followed all over Arabic states right upto countries like Morocoo, Tunisia & Libya. It followed the propagation of Islam.
Libya, for a short period, followed another era, named MD.
Egypt, though not calling themselves Arabs and using Egyptian language, continues to follow AH as calendar system.
Algeria, in a recent coin, has started using Berber era and it is expected to use that in new series circulation coins.
Propagation of Islam towards east of Saudi Arabia, resulted in neither Arabic nor AH being followed in Iran and Afghan where languages like Persian, Pushtu etc are in use and are of Indo European in origin ( as already indicated).The era used is SH.
However, further east, Indian Princely states, especially under Mughal influence, primarily followed Persian but calendar used was AH.