It varies, cross immunity is a thing for some families if viruses but not all. Sometimes the cross immunity is weak.
Seems like there’s no protection in the case of H5N1 from the regular vaccine, though. But there’s vaccines targeting it in development
There are vaccines in development already, but mass production is a complete different issue.