Yes, they can.
From the spell:
If you issue no commands, the creature only defends itself against hostile creatures. Once given an order, the creature continues to follow it until its task is complete.
If you order your animated objects to "Kill those orcs", they will do everything they can to accomplish the task until it is complete without you expending another action (bonus or otherwise) to do it. This would include making Opportunity Attacks, because they are creatures, there is no text that says they don't have a reaction, and an OA is triggered by the target moving out of a creatures reach.
On the other hand, if you only command them to "Attack this particular orc, this round", they would perform that task and then wait for further instructions, possibly retaliating if attacked.