Does anyone know the order that these are applied: rules, junk mail, out of office reply?

If I have out of office reply on, does mail that is moved the junk mail folder, still get the out of office reply?
I know I can set rules with out of office replies, but does the out of office reply happen first?
Can I limit to who (or is it whom?) the out of office replies will go?

Thank you!