You already found this from Wikipedia but what it means like-
Any square matrix A admits an LUP factorization. If A is invertible, "then it admits an LU (or LDU) factorization if and only if all its leading principal minors are non-zero". If A is a singular matrix of rank k, then it admits an LU factorization if the first k leading principal minors are non-zero, although the converse is not true.
bolded line says that if determinant(minor) of leading principal are non- zero then only a matrix admits LU factorization.
So now according to your examples-
1) $\begin{bmatrix} 2 &1 \\ 8 & 7 \end{bmatrix}$
principal submatrices are $\begin{bmatrix} 2 \end{bmatrix} , \begin{bmatrix} 7 \end{bmatrix}, \begin{bmatrix} 2 & 1 \\ 8 & 7 \end{bmatrix}$
but leading principal submatrices are $\begin{bmatrix} 2 \end{bmatrix} ,\begin{bmatrix} 2 & 1 \\ 8 & 7 \end{bmatrix}$
and determinant of all are 2, 6 which are non zero so above matrix admits the LU factorization.
2) $\begin{bmatrix} 1 &2 & 3\\ 2 & 4 & 5 \\ 1 & 3 & 4\end{bmatrix}$
principal submatrices are $\begin{bmatrix} 1 \end{bmatrix} , \begin{bmatrix} 4 \end{bmatrix}, \begin{bmatrix} 4 \end{bmatrix},\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix},\begin{bmatrix} 1 & 3 \\ 1 & 4 \end{bmatrix},\begin{bmatrix} 4 & 5 \\ 3 & 4 \end{bmatrix},\begin{bmatrix} 1 &2 & 3\\ 2 & 4 & 5 \\ 1 & 3 & 4\end{bmatrix}$
but leading principal submatrices are $\begin{bmatrix} 1 \end{bmatrix}, \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix},\begin{bmatrix} 1 &2 & 3\\ 2 & 4 & 5 \\ 1 & 3 & 4\end{bmatrix}$
and determinant of 1st leading principal submatrix is 1 and , for 2nd it is 0 which are not non zero so above matrix does not admit the LU factorization.
So yes your statement is correct.