Even if you get it working at all, Audacity 1.2.6 does not run well on modern versions of Ubuntu.
Multiple versions of Audacity can be installed if built from the source code by setting a different installation location when running configure. For example, to set the installation location to your home directory, use:
./configure --prefix=$HOME
A simpler method is to not actually install the second version but just to build it within a folder. The second version can then be launched by either typing the full path to the executable in the command line, or by opening a Terminal window, navigating to the folder where you have built the second version, and then typing:
./audacity
However, I would recommend against trying to install Audacity 1.2.6 at all.
If your only reason for installing is to run a particular "filter", then the same, or an improved version of that filter is almost certainly available for Audacity 1.3.12. Unfortunately I cannot give any more information about this aspect as you have not said what this particular "filter" is.
If you are unable to find information about particular Audacity filters here on AskUbuntu I would recommend that you ask on the Audacity forum.