If my partner and I were treated today for syphillis with a shot I penicillin, can we have intercourse?

Yes. But if your partner gave you syphilis it is also important to be tested for other stds, and seriously consider having your partner use condoms in the future.
If one of you is ... Treated because he/she is a sexual contact of an active case rather than both of you being clearly actively infected, wait a bit. Have you both been screened for other stds?