A starship supposedly is built to take thousand-gee accelerations routinely from her own impulse engines. And if warp one imposes any physical stresses, and those have a linear relationship to speed, then a starship capable of warp nine ought to also be capable of flying through a million miles of solid steel as if it weren't there. This being with hull strength and SIFs alone, before shields or anything.
External pressure would be somewhat different from acceleration, but not all that different. A million atmospheres doesn't sound particularly unrealistic. What would make the difference is not structural strength, but the ability to withstand being surrounded by a dense fluid. Where does the heat go? What vital interfaces will be blocked? Will external pressure push substances in? We know that the ship can take lots of pressure, but we also know that there are valves that will allow fluids in, as in "Obsession". Was that because the dikironium cloud found a way to change its form of existence to be transparent to the valve (while it could not make itself transparent to the ship's hull or even its internal walls)? Or simply because the cloud applied more than one atmosphere of external pressure on the valve?