It gets used more often to express prohibition not impossibility (“you can’t be in here” spoken to someone who manifestly is for example). Also disbelief (“this can’t be happening” about something that is happening). It’s just not clear which sense people mean it in, so it can’t be used when you want to be sure you can’t be misunderstood.
For another example of ambiguity, consider the sentence “A triangle can not have any obtuse angles”.
Is this 1) true, because there exist triangles with only acute angles, or 2) false, because triangles can have obtuse angles?