can you explain the need in more detail?
Does this come close to what you need?
m=rand(1:100, 4,3,5)
f(c)=!(c.I[1]==1 && c.I[2]==1) &&
!(c.I[2]==1 && c.I[3]==1) &&
!(c.I[1]==1 && c.I[3]==1)
m[filter(f, CartesianIndices(size(m)))]
more generally, the following predicate could be used (it remains to clarify / specify the case i = j = k = … = 1)
f(c)=sum((==(1)).(c.I))!=length(c.I)-1