Mutable types like Vector{Int} cannot be stored inline in an array; their undef value is a special marker, notifying that there is no object stored there. For String, much the same is true, due to their variable size (although not being mutable).
Immutable values like UInt8 though are stored inline, and because they are immutable and all possible bitpatterns are valid for them, they can be stored inline. An undef value can thus be any arbitrary value of that type.
Do note that reading from an uninitialized array is still not safe to do - this is technically undefined behavior.