Is it ok to have sex while I have a kidney infection? I'm on antibiotics. Can it make it come back or worse?

Should not. Generally speaking it's better to refrain from sexual intercourse during periods of time when treating your urogenital infections.
No. Finish your course of care, including fluids and rest. Once you are better then resume intimacy. Sexually active women are at higher risk for bladder infections, which lead to kidney infections in some patients. If urinary tract infections persist, see your doctor for more care.