What is the mechanism of the reaction of a ketone with sodium nitrite/ hydrogen chloride?
$\ce{NaNO2/HCl}$ is as you suggest a source of $\ce{HONO}$. This will be protonated by $\ce{HCl}$ to give the nitrosonium ion $\ce{NO+}$ (in equilibrium with nitrosyl chloride). This strongly electrophilic species will react with the enol of the ketone to nitrosate the alpha position. This nitroso compound then rearranges to give the alpha oxime.



Image from: Emilia Iglesias and Isabel Brandariz, A further study of acetylacetone nitrosation. Org. Biomol. Chem. 2013, 11, 1059-1064. DOI: 10.1039/C2OB26073E; available as pdf from pdfs.semanticscholar.org.