"I create sub-state machine “Unarmed Random” and set condition for it AttackID ==0."
the ID 0 is the default which goes to the 'Unarmed' state, you can remove the transitions from A to B to C inside and set transitions from AnyState to those states with the condition of the RandomAttacks
You need to set the transition to the submachine state Dead instead of inside the submachine directly to the states. Otherwise, it will always go directly to the state Dead 1 because it never enters the submachine which contains the random script.
You need to make an AnyState transition to the Dead SubMachineState with the condition "IsDead" true, add the RandomAttack (you can use the random attack, no need to create another one) behavior and inside add the condition RandomAttack from entry to your states.