Yes.

You can attack any enemy, no matter who you are combat-locked with.