Use a temp table in a Table-valued Functions
No.
You can use @table_variables
though. Although from a quick glance maybe a recursive CTE might work for you rather than using these child/parent tables at all.
You can use a table variable instead.
DECLARE @Child TABLE (Id INT, Name VARCHAR(255), ParentId INT, ParentName VARCHAR(255))
DECLARE @Parent TABLE (Id INT, Name VARCHAR(255), ParentId INT, ParentName VARCHAR(255))