Hierarchical generalization of dual unitarity