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.