The focal lenght won't vary for a prime lens, but the built length can vary.
The focal length is the distance between the so-called nodal point of a lens to the film plane, when focusing something at infinity.
(Actually there two... we are concerning the rear nodal point.)
That point not necessarily is located in the middle of a lens, it can even be located outside the lens assembly.
The latter is the case with retrofocus lenses (wide-angle lenses designated for SLRs). Where the nodal point should be positioned there is still the swinging mirror. Thus a lens type had to be made that mechanically is further off, but optically still in the mirror box.
Standard and some 'short tele' lenses are retrofocus as well. It's not until you get into the 85 - 100mm range that you can use a 'straight' (i.e. non retro- non-tele-) lens on most SLRs with a flange focus of 44~ - 48~mm.