Yes that's a good idea, provided it's proper compost and not just shredded cardboard.
Compost is decomposed organic living matter - grass, old plants, wood, etc.
Top soil may have some decomposed living matter in it, but it also has a mixture of inorganic hard materials, like clay and sand and stones. So soil has more 'substance' and weight to it.
Neither necessaiily have any nutrients. So you might still need to add some fertiliser or manure for some plants to grow well.
More expensive composts, like John Innes, do have some soil, and fertiliser, in them.