It's a confusing story. There are several different 'hosts' of cossacks, and Ukraine usually claims the heritage of the Cossack Hetmanate, which consisted of the Zaporizhian Host - Which technically was abolished somewhere in the 18th century, but really just kinda split up. Many Ukrainian volunteer battalions have Cossack names and logos, and some men even adopt the typical Cossack hairstyle. The anthem has a line that describes Ukraine being a Cossack nation.
The cossacks that fight on the Pro-Russian side are largely Don Cossacks. While once they considered themselves Ukrainian (We're talking 1920s here), the destruction of their own republic, oppression, WW2 and the confusing post-Soviet period have led to Don Cossacks considering themselves Russian. Their warrior/we-ain't-taking-shit-from-anyone/motherland-above-everything-culture has become pretty popular. Ukrainians might claim Don Cossacks are not true Cossacks because they have become Russian, and Don Cossacks will probably claim Ukrainian are traitors to the Russian motherland.