It is important to develop a highly active and stable transition‐metal catalyst with dual‐functional properties in the reversible transformations between various saturated and unsaturated N‐heterocycles. Herein, we prepared the cobalt nanoparticles (Co NPs) apically encapsulated by the N‐doped carbon nanotubes catalyst (Co@NCNTs) via a multiple pyrolysis of low‐cost dicyandiamide and cobalt (II) acetylacetonate. The catalyst shows excellent activity and recyclability towards the oxidative dehydrogenation (ODH) and the catalytic transfer hydrogenation (CTH) for various N‐heterocycles. The structure of outer N‐doped carbon nanotubes (NCNTs) can protect Co NPs from aggregation and leaching. Moreover, the encapsulated Co NPs and the NCNTs may generate a synergistic effect. Both of them facilitate the high performance. The poisoning tests with KSCN were to clarify the different active sites for ODH and CTH reactions: the Co NPs could modify the NCNTs through electrons redistribution, therefore the NCNTs could directly activate O2 in ODH. The encapsulated Co NPs is enhanced by the doped N atoms which is good for the H2 activation in CTH. What's more, the mechanisms of ODH and CTH reactions were also proposed. This work provides a facile and low‐cost method to design catalysts, which are dual‐functional, highly active and stable, for industrial applications.