Yes, you can even use it to support your fasting!
You will get the maximum effect if you do your training session at the end of your fasting period. This is when growth hormone secretion is at its highest level. This is ideal for building and maintaining muscle as well as burning fat.
Listen to your body and adjust the training intensity to your energy level if necessary.