All $p$-groups, i.e., groups whose order is a prime power $p^m$, are nilpotent, so any nonabelian group of order such a power is an example (necessarily $m \geq 3$). Conversely, all finite nilpotent groups are direct products of groups of prime power orders.
So, the nilpotent, nonabelian groups of order $< 2^5$ are:
- Order 8
- dihedral group, $D_8 \cong \langle (14)(23), (1234) \rangle$
- quaternion group, $Q_8 \cong \langle (1247)(3685), (1348)(2576) \rangle$
- Order 16: all $9$ nonabelian groups
- Order 24: $C_3 \times D_8$, $C_3 \times Q_8$
- Order 27: $(C_3 \times C_3) \rightthreetimes C_3$, $C_9 \rightthreetimes C_3$
All of these groups can be realized as groups of permutations of $n \leq 12$ objects, except for $Q_{16}$, the generalized quaternion group, which embeds in no symmetric group smaller than $S_{16}$.