Edit: I'm asking about commoner, and lower nobility households.
English is not my main language, hence the misunderstanding.
This scenario never occurred in any of the major dynasties of Chinese history (traditionally the Han, the Tang, the Song, the Ming, and the Qing, with the optional inclusion of the Yuan). In fact, it would be very difficult for all the male members of imperial clan to die off in any decently lasting dynasty. For example, with the Ming:
As the years pass, there are more and more members of the imperial clan (a significant economic burden for the state) and a greater and greater possibility of the clan surviving any calamity.
Anyhow, theoretically, the empress dowager as the most senior surviving member of the imperial clan would have to appoint a new emperor. The authority of the empress dowager was used to justify and legitimize a coup d'etat - for example, during Guo Wei's founding of the Later Zhou dynasty, the empress dowager of the Later Han dynasty was coerced into proclaiming the rebel general the emperor. In practice, however, there would simply be immense chaos on a plethora of levels.