Yes, the dog can be vaccinated during her heat cycle before the planned mating.   You can keep a few days gap between the shots and the planned mating after receiving the vaccine. The dog can go through some side effects like mild reaction and weakness.  It can be difficult to recover if the mating is done right after the vaccination. Always plan mating after a few weeks of vaccination.