Find the solution. Can do the same using functions:
CREATE FUNCTION test_0 ()
RETURNS @t table (ID int)
as
begin
insert into @t values (1),(2),(3)
RETURN
end
go
CREATE FUNCTION test_1 ()
RETURNS @t1 table (ID int)
as
begin
insert into @t1 (ID)
(select ID from test_0())
RETURN
end
go
declare @t2 table (ID int)
insert into @t2 (ID)
(select ID from test_0())
insert into @t2 (ID)
(select ID from test_1())
select ID from @t2
drop function test_1,test_0
go