can an autopilot be programmed to follow a route dictated by a winds aloft forecast?
Yes, but the question is how it is done, and these days it's better to think of it as not just the autopilot, but a Flight Management System (FMS).
In the case of the North Atlantic Track system explained by John K, the waypoints that define the route an airplane is to take are defined by latitude and longitude.
In my day (old fart-retired in 1999) the waypoint lat/long values were read to us over the radio, and we entered them into inertial navigation system system (actually 3 of them) which then controlled the autopilot—they voted so to speak.
These days there are a better ways of getting the assigned route into the FMS, and which hopefully someone familiar with them can explain.
The point is, though, that the FMS is not looking at the winds aloft forecast and deciding the route, it's simply flying a route given to it by some means that has been ordered by a ground controlling facility to take advantage of the winds.
Now, could an FMS be programmed to receive the winds aloft forecast and decide from that the best route. Probably so, but when you add in the complications of separation for all the other aircraft doing the same thing, I don't think we're there yet. In other words, automated ATC is still down the road a ways to say the least.