Yes, they can make opportunity attacks.
From the description of the animate objects spell:
You decide what action the creature will take and where it will move during its next turn, or you can issue a general command, such as to guard a particular chamber or corridor. 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 needing to expend another bonus action (bonus or otherwise) to do it. This would include making opportunity attacks, because:
- animated objects are creatures
- there is no text that says they can't take a reaction to do so, and
- an opportunity attack is triggered by the target moving out of a
creature's 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.