It is pretty much never legal to engage in a revolution against the currently established government. Not by the laws created by and supporting that government, it isn't. I am reminded of the couplet by John Harrington:
Treason nae'r doth prosper, what's the reason?
Why if it prosper, none dare CALL it treason.
The US Declaration of Independence was a political document, attempting to justify a revolution then in progress, it was not and is not a legal document, and it does not make actions similar to those undertaken by the Americans who revolted against Britain legal in future.
A revolution may be justified. It may even be morally essential. But those are judgement calls. No court, except the court of public opinion, and later the court of history, will rule on them.
There is no mechanism in existing law that states that allows for some kinds of revolution to be legal.
The Second Amendment as currently interpreted allows people to purchase and posses firearms and other weapons, and rules out most regulations of such ownership, although not all. The formal reason for this in the amendment itself is:
A well regulated Militia, being necessary to the security of a free State ...
That would suggest a possible need to call on the militia to defend the country against foreign invaders, or possibly against revolts. Nothing in it says that the purpose is to allow the people to oppose tyrannical governments. At the time the US Constitution was written, the militia was considered to be an important source of reserve military power against invasions and rebellions.
The relatively recent US Supreme Court decisions which used the 2nd amendment to overturn local gun control laws cited the need for an ordinary, law-abiding citizen to be able to defend against criminals, particularly against home invasions. That case was in the context of a law which made it almost impossible for anyone to lawfully own a handgun, even an off-duty police officer. It explicitly said that some regulation would be permitted. It did not in any way say that ownership of weapons would be useful for legal rebellion, or justified rebellion.
As the answer by o.m. says:
The 2nd Amendment allows the citizens to stockpile arms, which helps both justified and not justified revolutions. Finding the justification for a revolution is a moral category, not strictly a legal question.
I fully agree.