Solar sails are a great, inexpensive way to move out from the sun, if you’re not in a hurry. Ocean going ships are able to tack against the wind, and to move up wind. Could a solar sail gain inbound (towards the sun) momentum by tacking?
No, because there's nothing like water for a keel to work against.
In water sailing there are two force vectors, the vector from the reaction of the wind against the sail, and the vector from the keel and rudder against the water. These vectors add together to propel the sailboat. This works for almost any direction on the compass except where the wind is coming from, or about 45 degrees either side of that. "Beating close to the wind" as @geoffc mentions, is traveling up against that limit. "Tacking" is zigzagging - going for a while 45 degrees clockwise from the wind, and then for a while 45 degrees counterclockwise. Working your way upwind.
In solar sailing there's just one force vector, because there's only one medium, the solar photons, as @Craig mentions. With one vector the direction limits become more than 90 degrees to either side of where the sunlight is coming from. So no zigging, no zagging, using anything like tacking.
Now maybe gravity can be used as another vector via orbital mechanics as @Pearson and @SF mention, and maybe one day this will be called "tacking" but the physics are wholly different than a keel through water.
In some ways an E-sail [made of 20km-long tethers with a positive charge, repelling solar wind particles] resembles a solar sail, a rival idea for powering craft cheaply through space. A solar sail provides propulsion because the sunlight it reflects exerts pressure on the sail, pushing it forward. But E-sails have an important advantage over solar sails. Once unfurled, there is no easy way to stop a craft with a solar sail gathering speed. An E-sail-powered craft can be prevented from accelerating simply by switching off its electron gun. This means it can return to Earth under the influence of the sun's gravity.
You cannot directly propel the solar sail towards the sun.
A solar "sail" is basically a mirror. The analogy of wind and sails on ships is not useful for understanding how solar sails work.
Each photon from the sun which strikes the sail is reflected. Each photon imparts a small amount of momentum. If the sail is pointed directly at the sun then you get twice the photon's momentum added to the sail. If you angle the sail, then you are sending each photon off in a direction that is not directly back towards the sun; That gives you a net force to one side. So you can control the vector of the total force of the reflecting photons, but the net direction is always more than 90 degrees from the sun. As the mirror approaches edge-on to the sun, the net force vector would approach 90 degrees from the sun and drop to zero magnitude.
(Note that the pressure from the sun's photons applies to anything. It doesn't have to be a designed sail. Orbital mechanics currently take "light pressure" into account for accurate determinations of space craft orbits.)
You can alter your orbit using a solar sail.
You can use the momentum from the solar sail to alter the orbital eccentricity to move a part of the orbit closer to the sun, etc.
If you want to go directly towards the sun from the earth, you don't need a force pushing you directly toward the sun. You need a force pushing against your normal orbital direction. That decreases your angular momentum about the sun, and you then fall towards the sun due to gravity.
This is actually somewhat easier than you would think. In the world of Orbital Dynamics, you only have to accelerate or decelerate your orbit to move closer/further away from the object you are orbiting. So, all you have to do is create a net momentum that pushes to slow down your orbital velocity.
However, a big part of what makes tacking work is the fact that you are forcing the water to act as a friction medium against the wind, in essence, causing it to slow you down.
I'm not an expert in such motion, but I believe a configuration like below would work, assuring the arrow is the direction of orbital motion, and the sail is the T like item. The direction could be off by 90 degrees to make this happen, and it might not work really close to the sun, but it should get you in the right direction at least.
Source: Ben Diedrich via SolarSailWiki, CC BY-SA 3.0
In fact, this has already been done, by a Japanese probe called Ikaros. It sailed using the sun to Venus, from Earth Orbit, and thus demonstrated that this is possible.
While you can't do tricks common for normal sails due to lack of water to keep your keel from drifting sideways and normally lets the ship travel upwind, you are still able to extract force diagonal to the sun radius (the angle of incidence equals the angle of reflection; resulting force is perpendicular to the surface), aimed outside the Solar system.
Now, this wouldn't let you travel inwards, except... - you can apply said force with the lateral component directed against your orbital speed vector. That way, despite the parallel component pushing you outside, against the Sun gravity, your orbital speed and resulting centrifugal force drops; and while the outwards component of the solar sail push is only momentary, your orbital speed loss accumulates and leads to continuous reduction of your orbital radius.
In other words: Solar sail lets you change orbital speed. Sun gravity can make you travel towards the Sun, depending on said speed.
In sailing, tacking is used to sail as close to the wind as you can (obviously not straight into it, though the hard wing Americas Cup boat might have been able to) while still generating lift in the sail. For normal boats this means at best a 25-30 degree angle to the wind. Thus you sail a zig zag pattern and need to tack, else you get way off course.
Wind sails do not work by pressure of the wind, pushing them, except in straight downwind situations or in older square sail you see in movies about pirates, etc.
Modern sails have curvature and loft and work as vertical wings, generating lift from the pressure differential created by airflow at different speeds over the two sides of the wing.
Solar sails do not have that ability, as photons do not act like air molecules in an atmosphere. Thus they need to sail, straight 'down wind' as it were.
Yes. By using gravity gradient from nearby planets and the Sun. The sail isn't moving trait out from the Sun. It is also in orbit around the sun as it is moving all the sail would have to do is large body or angle the radiation pressure in the direction of travel to slow its speed to where the Sun's gravity pulls it in.