Very possible, though the accuracy depends on having a good map, and even better an inertial nav system that calculates position. The original Boeing 747 had a nav system that could, with only knowing initial position ( as in where the nosewheel was on the painted dot on the apron which was surveyed as the reference position for eg Heathrow terminal 1 gate 5) use that, along with a very heavily damped magnetic sensor in the tail, could accurately navigate the plane from Heathrow to Perth Australia with no additional correction inputs, and get there with a CEP of around 1km in position. Use closer points and you could get it smaller, but in all cases it was definitely good enough to navigate.
Major issue is the design of the low drift ultra precision gyro assemblies, which are not an easy thing to make from scratch. Most older missiles in any case also depended on other terminal guidance, like having a star tracker in the coast phase to refine position, using a few known stars in the sky. Others like the Tomahawk use a stored terrain map and a RADAR to get contour pattern and then fly a defined path, using GPS and INS over large stretches of water to get position.
submarines are easy to detect, the USA has a good number of hydrophone systems that run along the deep oceans approaching the shores, which can track the movement of ships just from the noise.
A submarine, unless it is nuclear powered, will have some large noisy diesel engines, and will spend most of the time on surface doing a better speed than the typical 5 knots submerged. Small yes, but trackable, and if sat recon shows no ship there but a big engine running then somebody will come looking for it, and then track it underwater with active probing till it surfaces from lack of power. If they detect neutron radiation coming from it ( hard to shield unless you have a few tons of Osmium shielding or similar DU shielding) they very likely will board, and then arrest the crew.