The delta-v needed from low Earth orbit to a Hohmann transfer orbit with a periapse inside the Sun is actually "just" 21,300 m/s. But there is a better option. A bi-elliptic transfer to just hit a central body is better when the ratio between the orbital radius and the radius of the central body is larger than 4.82. The orbital radius of the Earth divided by the radius of the Sun is larger than 200. Therefore, accelerating up to solar system escape velocity, and then do a minuscule manoeuvre at a great distance is only going to cost 8750 m/s of delta-v from LEO. Even that is impossible for an ICBM. A fly by of Jupiter is even better, and combined with a multi fly hit-the-sun trajectory, it is only going to cost around 6300 m/s.
The theoretically lowest is however not going to cost more than a transfer orbit towards the Moon (3120 m/s). With three Moon flybys, you can escape the Earth-Moon system with a little $v_\text{inf}$. After a long time waiting for the then long synodic period to sync up, you can do a flyby of the Earth-Moon system to increase the $v_\text{inf}$. (You can not increase the $v_\text{inf}$ just with a flyby of a planet, however, you can if it is a two body system. That is the same effect as a binary star flyby, only much weaker.) Repeat this over again several times for the next century, and the warhead would hit the Sun.
3120 m/s is maybe achievable if you replace parts of the warhead with an upper stage, as a regular ICBM has trouble even going into orbit. Even then, major upgrades are required. But at least, it is within the same magnitude.
Of course, why are you going to nuke the Sun? I assume you have a good reason for that. (Kind of not assuming that actually)