Do I write ".22 rifle" or "twenty-two rifle"?
Solution 1:
Well, I'm not familiar with firearms, so if I were reading a novel and it said
"He had a .22 rifle," Bob remarked.
then I'd probably pause for a moment while I figured out how to pronounce ".22" in my head. On the other hand, if the novel said
"He had a twenty-two rifle," Bob remarked.
then I'd be able to read it fluently without pausing, and I'd still understand the meaning just as easily.
Of course, not everyone actually imagines the characters speaking. (Perhaps most people don't.) But I don't see any reason not to write this out in dialogue.
Solution 2:
In any fiction I’ve read, if the caliber of a firearm was mentioned, it was always written out numerically, e.g., “a Colt .45”, “a .22 rifle for varmint hunting”, “a .38 Police Special”, “a 9mm Glock” which are corroborated by almost all examples found via Google Books (Colt .45, 22 rifle )
(I will note that I am American, and virtually all of the fiction I’ve read—mostly ‘thrillers’, SF, or ‘MilFic’—has conformed to American conventions, even if originally BrE [e.g., the Harry Potter novels, which do not mention firearms or their caliber].)
Solution 3:
I have a little familiarity with firearms and I have never heard anyone call a .22 rifle a twenty-two, always a point two-two, with point being optional. My experience of firearms is limited to the UK and Europe.
If I heard (possibly even if I read) the expression twenty-two rifle I might think it was something like a thirty-thirty rifle, in which the first thirty is the calibre (0.30 inches) and the second thirty is the standard load, in grains, of the ammunition.
Then there is the expression thirty-aught-six or 30-06 which is a type of rifle ammunition. Again, the thirty is the calibre, but the aught-six is the year of its introduction to use by the US Army (1906, rather than 2006).
I think that if OP is writing fiction they would be well advised to get this kind of detail right (and therefore stick to .22 or two-two in this case). To people to whom this kind of verisimilitude matters, it matters. To the rest, they won't care either way.