KABUL—Young Afghans rebelling against the traditional daytime fast during the Muslim holy month of Ramadan have been turning to secretive cafes in the capital willing to risk serving lunch.

It is a potentially dangerous business in a city where most residents still follow a strict interpretation of Islam and crowds have been known to turn violent when religious sensibilities are offended.

The...