Note that the part labelled a hem in the picture is not a hem- it is a separate piece of fabric. A hem is the edge of the fabric, folded over once or twice and then sewn to the fabric, to prevent the fabric from fraying. It is just the part below the stitching in this photo:
[
Because the hem is always part of the main fabric, we don't say that the hem has come off if the stitching fails: we say that the hem has come loose or undone. This can be seen from this NGram graph.
Regarding your question, the Cambridge dictionary offers this definition of to:
used to say where something is fastened or connected
The preposition to is used almost exclusively when talking about hems, as this NGram graph shows. Another example of this usage is the children's game "pin the tail on the donkey". Google does not recognize onto, and suggests on.
Both stitch and sew are used, but stitch is somewhat more common. The correct sentence should therefore be:
The hem has come undone. Stitch the hem back to the skirt
Update following changes to the question
There isn't really a technical term for this part of a dress: the closest words are
flounce: a wide strip of cloth sewn along the edge of especially a dress or skirt for decoration
tier: one of several layers or levels
A flounce is usually a lot wider than the bottom of the dress, so that it sticks out. For a tiered dress, each band overlaps the band below it.
The best way to describe it is probably to call it the bottom band of the dress. For this situation, on, onto and to are OK. I would prefer on, and this NGram graph supports my opinion. The complete sentence would look like this:
The bottom band of the dress is coming off. Sew it back on.
Alternatively you could talk about the join between the bottom band and the rest of the dress- the seam.
The bottom seam on your dress has come undone. Sew it back together.