Is 1998 forester auto transmission and manual transmission share the same ECM?

Short answer is "no." The automatic transmission is controlled by the ECM. It learns your driving habits and adjusts shift points accordingly. No need for such functioning on the manual transmission model. Often manufacturers make subtle changes to models while they are in production, such as using a component from a different supplier, and the ECM may be changed to accommodate. The only way to find the correct replacement is to match up the code numbers on the unit.