Yes, you can apply for the transit visa to UAE if you are a Citizen of Afghanistan. It is applicable to 48 Hours of Transit and 96 Hours of Transit, both with a 14 days validity of visas respectively.