To neighboring countries yes, but not across multiple borders.
The only exception from that was taking a train from Germany via Belgium to Luxembourg, but that hardly counts.
Else I've done Germany -> Austria, Luxembourg, Netherlands, France, Czech Republic on individual trips, and also did Denmark -> Sweden, Sweden -> Norway and Czech Republic -> Austria (in a sleeper)
Germany -> Austria can cross multiple borders. There is a direct train from Berlin to Vienna via Prague. I also traveled an indirect one and had a nice lunch brake in Prague.