Of course, they have no idea what a period is but their heightened sense of smell means that they can pick up on the different scent that comes from you as a result of hormonal changes and menstrual blood.
The latter may be the result of your dog sensing hormonal changes in you.