The magnetic structures and spin dynamics of Na$_{2}$Co$_{2}$TeO$_{6}$ and Na$_{2}$Ni$_{2}$TeO$_{6}$ are investigated by means of elastic and inelastic neutron scattering measurements and the results are discussed in the context of a generalized Kitaev-Heisenberg model on honeycomb lattice with strong spin-orbit coupling. The large number of parameters involved in the Hamiltonian model are evaluated by using an iterative optimization algorithm capable of extracting model solutions and simultaneously estimating their uncertainty. The analyses establish that both Co$^{2+}$ ($d^7$) and Ni$^{2+}$ ($d^8$) antiferromagnets realize bond-dependent anisotropic nearest-neighbor interactions, and support the theoretical predictions for the realization of Kitaev physics in 3$d$ electron systems with effective spins $S$=1/2 and $S$=1. Furthermore, by studying the Na-doped system Na$_{2.4}$Ni$_{2}$TeO$_{6}$, we show that the control of Na content can provide an effective route for fine tuning the magnetic lattice dimensionality, as well as to controlling the bond-dependent anisotropic interactions.