A necessary truth is something which is true in all possible worlds. How can we be sure that there is no other universe where 2+2=4 can be untrue.
The issue is complex and any "significant" answer is hardly reducible to the Yes/No pattern.
In modern mathematics, 2+2=4 is a theorem of arithmetic provable from Peano axioms.
In a nutshell, assuming the definition of 1 as "the successor of 0" and of 2 as "the successor of 1" and ... and of 4 as "the successor of 3" (and thus "the successor of the successor the successor of the successor of 0"), the axioms formulated with the primitive notions of:
0, S (successor), + (sum) and (×) multiplication,
allows us to conclude that:
"the sum of the successor of the successor of 0 with the successor of the successor of 0 is equal to the successor of the successor the successor of the successor of 0".
Having established this fact, we may assert that it is a logical consequence of Peano axioms, or that it follow (necessarily) from them, or that it holds in every model of the axioms.
If we want, we may paraphrase it as follows: it is true in every possible world in which Peano axioms hold.
Now the question is:
are Peano axioms necessary truths ?
i.e. do they hold in every possible world ?
I would say: no.
There are models of Robinson arithmetic [that basically differ from Peano's one for the lack of induction] where the usual associative, commutative, or distributive laws for addition and multiplication do not hold.
Neither the law Sx≠x can be proved with only Robinson's axioms [see this post for details].
Thus, it seems that the "usual" arithmetical axioms are not necessary truth (according to the above naive view : necessary = true in every possible world) and thus neither the "usual" arithmetical facts are.
For mathematical statements the standard interpretation of "necessity" is "logical necessity", and "possible world" is a model of a theory to which the statement belongs. The theory in question here is presumably the Peano arithmetic, so one can derive that 2+2=4 is necessary from the fact that it is a theorem of Peano arithmetic, and the Gödel's completeness meta-theorem, which states that something is a theorem in a consistent first order theory if and only if it is true in all of its models. However, there are plenty more arithmetics to choose from, Presburger, Meyer, primitive recursive, second order, or the modular arithmetic mod 3 for that matter, in which 4 is not even a valid symbol, and 2+2=1.
But your question suggests that you see 2+2=4 as having some empirical content, otherwise the question of certainty is kind of moot. There is something to it, our arithmetic rather transparently tracks the behavior of our familiar everyday objects, like sticks, pebbles, etc., and a universe where objects say merge like drops of water is imaginable. In this case however it is more appropriate to say not that 2+2 is not 4 in arithmetic, but rather that creatures in such a universe have little use for arithmetic like ours. In other words, 2+2=4 is part of the "grammar" of "2", "+", "=", and "4" (not just symbols but concepts behind them), if it does not hold it means that someone is simply using different concepts. Here is Tait:
"The a priori character of numerical reasoning arises simply from our freedom in this sense to use the number concept only as we have characterized it... There is nothing behind this usage, e.g., mental or physical states or some hidden mathematical reality, against which it can be measured for correctness. We can agree now to use the number concept in a certain way... Not only is our agreement concerning the number concept not binding on future generations, but our agreement is spelled out in ordinary English (ultimately) and depends on our common disposition in the use of that language. A sufficient breakdown of those dispositions would render the question of "same number concept" meaningless."
Finally, there is a third version of the question, namely taking the more conventional possible worlds, when different physically possible universes are considered, and asking how we ensure that 2+2=4 holds in all of them. This is unexpectedly subtle, logic and arithmetic are usually not taken as parts of any possible world, but rather as what Forster calls "modal machinery" residing in the "modal aether" beyond them:
"Indeed it could be characterised as that part of our theory of nature that remains when all information internal to possible worlds is ignored altogether, rather in the way in which the geometry of space-time is what remains once we expunge events... Can the machinery be properly described inside all possible worlds, despite appearances? Or does it go on outside them, in a modal aether?... at least some necessary truths are true not in virtue of what happens in possible worlds, but true in virtue of what happens in the aether. In other words, possible world semantics doesn’t provide a uniform account of necessary truth."
In other words, 2+2=4 is not necessarily true because it is true in all possible worlds, it is true in all possible worlds because it is set up to be so, by design. I suppose one could set up a system of possible worlds sporting different logics and arithmetics within them, but that is not usually done, and somewhat futile. One would still need some logic and arithmetic in the aether to make the modal machinery work, and many supporters of the alternatives have their own accounts of modality, without the Platonism of possible worlds. So stuffing them into ones would beg the question, see Is there modal logic without possible worlds?