In Team Fortress 2, the difference comes down to direction. Fabricating is turning scrap into an item — you build something new from raw materials.
Rebuilding is the reverse: you take existing items and combine them into another item, such as rebuilding two hats into one hat.