AA cells can be installed in a socket of larger diameter than itself, if you wrap it in several layers of paper, foam or any other available material suitable for this purpose. For example, a galvanic cell AAA can be installed in a standard socket AA.
If the length of the socket is greater than the length of a galvanic cell between their respective contacts should be inserted in a folded several times a piece of aluminum foil.