The moving bits of the rudder need to be balanced after it's painted. So it's usually painted prior to installation.
It's a pretty common sight around the Boeing flight line to see otherwise unpainted aircraft with the hinged portion of the rudder painted.
I don't know about the engine nacelles...