Veterinarians generally advise against spaying a dog while she is in heat. During this cycle, the reproductive organs are engorged with blood, which increases the risk of excessive bleeding and surgical complications.
It is usually safer to wait until the heat cycle has ended before scheduling a spay. Your veterinarian can recommend the best timing based on your dog's health and breed.