Self-dual codes over finite fields and over some finite rings have been of interest and extensively studied due to their nice algebraic structures and wide applications. Recently, characterization and enumeration of Euclidean self-dual linear codes over the ring Fq + uFq + u 2 Fq with u 3 = 0 have been established. In this paper, Hermitian self-dual linear codes over Fq + uFq + u 2 Fq are studied for all square prime powers q. Complete characterization and enumeration of such codes are given. Subsequently, algebraic characterization of H-quasi-abelian codes in Fq[G] is studied, where H ≤ G are finite abelian groups and Fq[H] is a principal ideal group algebra. General characterization and enumeration of H-quasi-abelian codes and self-dual H-quasi-abelian codes in Fq[G] are given. For the special case where the field characteristic is 3, an explicit formula for the number of self-dual A × Z3-quasi-abelian codes in F3m [A × Z3 × B] is determined for all finite abelian groups A and B such that 3 |A| as well as their construction. Precisely, such codes can be represented in terms of linear codes and self-dual linear codes over F3m + uF3m + u 2 F3m . Some illustrative examples are provided as well.