A combination of \smash[b] should work:
\documentclass{standalone}
\usepackage{amsmath}
\newcommand{\block}[1]{
\underbrace{\begin{matrix}1 & \cdots & 1\end{matrix}}_{#1}
}
\begin{document}
$
\underbrace{
\begin{pmatrix}
1 & \smash[b]{\block{k}} \\
&& 1 & \smash[b]{\block{k}} \\
&&&& \ddots \\
&&&&& 1 & \block{k}
\end{pmatrix}
}_{T}
$
\end{document}

If you don't want to space the dots in the underbraced blocks, then change the definition:
\documentclass{standalone}
\usepackage{amsmath}
\newcommand{\block}[1]{
\underbrace{1 \cdots 1}_{#1}
}
\begin{document}
$
\underbrace{
\begin{pmatrix}
1 & \smash[b]{\block{k}} \\
&& 1 & \smash[b]{\block{k}} \\
&&&& \ddots \\
&&&&& 1 & \block{k}
\end{pmatrix}
}_{T}
$
\end{document}

For getting the underbrace only inside the delimiters, it's more complicated, because we don't want that the underbrace is considered when sizing the delimiters, yet we want to consider the vertical space taken by it.
\documentclass{standalone}
\usepackage{amsmath}
\newcommand{\block}[1]{
\underbrace{1 \cdots 1}_{#1}
}
\newcommand{\underbracedmatrix}[2]{%
\left(\;
\smash[b]{\underbrace{
\begin{matrix}#1\end{matrix}
}_{#2}}
\;\right)
\vphantom{\underbrace{\begin{matrix}#1\end{matrix}}_{#2}}
}
\begin{document}
$
\underbracedmatrix{
1 & \smash[b]{\block{k}} \\
&& 1 & \smash[b]{\block{k}} \\
&&&& \ddots \\
&&&&& 1 & \block{k}
}{T}
$
\end{document}

tikzmarkwould be very useful – Herr K. Nov 19 '13 at 00:41