It could, as it did against Russia in Ukraine v. Russia (2022). But note that in Ukraine v. Russia it specifically cited the resolution adopted by the General Assembly under Uniting for Peace addressing the Russia invasion as a violation of the UN Charter as a violation of the sovereignty and territorial integrity of another UN member, that is, it was addressing an operation already declared illegal independent of the issue before the Court.
Ordering a halt to an operation that otherwise might fall within the recognized UN Charter right if individual or collective self-defense is, especially when the allegedly aggressing party is not subject to the order, seems pretty hard to justify as a provisional measure.
(One might also note the absence of an effect of that order in Ukraine v. Russia.)