Selecting elements satisfying a condition
When I'm stuck with a problem like that, I always try to decompose it into simple, testable functions, that I can understand more or less at one glance.
The first thing you want is to check if two lists share the first or last element:
shareFirstOrLast[{a_, b_}] :=
First[a] == First[b] || Last[a] == Last[b]
Then you want to extend that to more than two elements:
shareFirstOrLast[{a_, b_, rest__}] :=
shareFirstOrLast[{a, b}] && shareFirstOrLast[{b, rest}]
(this recursion will essentially call shareFirstOrLast[{a_, b_}]
on every consecutive pair of elements.)
Finally, test that function on different samples and edge cases. If it fits your needs, use it with select:
Select[test3, shareFirstOrLast]
{{{1}, {1, 2}, {1, 2, 3}}, {{2}, {1, 2}, {1, 2, 3}}, {{2}, {2, 3}, {1, 2, 3}}, {{3}, {2, 3}, {1, 2, 3}}}