All ice dancers we see on TV start with the same stuff as all of us start with: stroking, edges, knee bend, glide, posture. They learn it in lessons with groups and in private lessons just like everyone who's learning to skate. You see all those moves on TV: the couples have fantastic edges, posture and lines.
As for the more intricate moves, it is as gkelly has already pointed out: the couples who do these moves started at an early age and come to do the difficult moves when they are advanced skaters on a high level. They need extra coaching for risky moves and practise them every day. They do off-ice training and rehearse the moves on the floor before they try them on ice. Of course they all have to pass tests, but the most important thing is to have constant, good coaching and training for many, many years.
Coaches and instructors won't allow any beginner skater to try something difficult or risky. If our instructors see a child on the ice trying a risky move that hasn't yet been taught in their course, they tell them to stop it.
Many skaters we see on TV have a long injury history, some girls have fallen from lift positions and were badly hurt (there was a thread about these falls here in the forum). The men who happened to lose control and had "dropped" the girls often need psychtric help afterwards because they feel so guilty they often don't want to skate anymore. The pure thought of that is absolutely dreadful.
Trying a difficult move - especially if we're talking ice dance and everything including lifts with two people involved - can be life-threatening when you're not supervised by an experienced person who knows how to do it. And said experienced persons will only allow you to try it when you're ready for it.