This should be fine for the primer. Most primers dry fast. You will need to stop applying the primer about 4 hours before the expected rain. If the primer is a little damaged it is easy enough to fix.
If you can wait then that is a safer course to take. Make sure the surfaces are dry before applying any primer.