Will the same TNT pattern always give exactly the same blast pattern if ignited in the same way? Is there any element of TNT or other explosive's detonation that is random?
No, explosions do have random elements, and are therefore not deterministic.
The Minecraft Wiki has an in-depth analysis of how explosions work in Minecraft. The relevant bit:
An explosion can destroy nearby blocks. Its effect is evaluated independently on many explosion rays originating from the explosion center […].
- Each ray has an initial blast force randomized in [0.7 × power, 1.3 × power].
So an explosion consists of lots and lots of separate "blast rays" that have a random variance of up to 30%, and are therefore non-deterministic.
The article even answers your question outright:
[…] But how many blocks an explosion can destroy is non-deterministic and also dependent on the specific location of the explosion.