This white cotton head scarf with a pattern of blue dots and smaller blue dashes is called a tenugui. Tenugui cloths were sometimes used around the house, but were often worn (by men) tied around the head. A tenugui like this one would have been worn at an Obon festival (though this particular scarf was not necessarily worn).
Obon is a Japanese Buddhist festival that honors the spirits of ancestors and the sacrifices they have made. The three-day summer festival typically includes the traditional Bon-odori dance (which differs according to region). Obon originated over 500 years ago from a story about Mokuren (Maha Maudgalyayana in Sanskrit), a disciple of the Buddha who wished to aid his deceased mother, who was suffering in the Realm of Hungry Ghosts (gaki). Mokuren followed the Buddha's advice and left offerings on the fifteenth day of the seventh month, securing his mother's release from that torturous realm of existence. The disciple danced with joy at his success, setting the precedent for the Bon-odori. Today, Obon festivals may include carnival rides and summer festival foods, as well as the traditional Toro Nagashi (floating of the lanterns). Because Obon honors the deceased, the festival is sometimes associated with ghosts and other yokai (supernatural creatures), who are believed to wander more freely during this time.