HSG is usually timed in the first half of the cycle, before ovulation, so there is no chance of a pregnancy being exposed to the x-ray. Since you ovulate around day 14 to 18, no egg had been released yet when you had intercourse on day 6, so this doesn't put a pregnancy at risk for a day 7 test.
Next Steps
Most centres still do a quick urine
pregnancy test on the morning of the HSG as routine practice. Mention this cycle's timing to your radiologist or gynaecologist so they can confirm you're clear to proceed that day.
Health Tips
If your cycle runs shorter than usual this month, or you notice early ovulation signs, hold off and check with your gynaecologist first.