No, a transmission from a 1995 Dodge 1500 with a 318 engine will likely
not fit a 1997 Ram 1500 with a 360 engine without significant modifications, and even then it's probably not advisable. While both trucks might use similar-looking transmissions, there are subtle, but crucial differences in bellhousing bolt patterns, input shaft lengths, and potentially even output shaft configurations. The 360 engine's greater torque could also stress a transmission not designed for it.
You'd be better off finding a transmission specifically designed for a 1997 Ram 1500 with a 360 engine. Checking the transmission codes on both trucks would confirm the incompatibility. Even if some parts *seem* interchangeable, the risk of failure is high.