If the package manager keeps track of where things are installed, any program that would need to know if a given program is installed and where would just check the place where the package manager stores that information.
Regarding DLLs in Windows, in the rare cases i need a program to use an specific DLL instead of the one present in PATH i just put a copy of the DLL in question in the same folder as the executable, and in several instances i've updated a DLL because of one program, and didn't even had to do any tricks to keep other programs working, the newer version of the DLL remained compatible (perhaps nowadays developers are more carefull when releasing newer version of their DLLs? Or perhaps i've just been lucky all these years...)