The rules of basketball make it pretty clear that you can't touch the ball while any part of you is out of bounds. The rules are different if a player steps out without the ball. Players who go out of bounds can legally rejoin the play and touch the ball once they have both feet back on the court.
Video of the Day
Players are considered in or out of bounds based on where their feet were before they touched the ball. If a player leaps from out of bounds to touch a ball before she lands in-bounds, it's a turnover. The reverse is also true, as players can jump from inside the court and touch a ball as long as they're not touching it when they land out of bounds. An example is a player leaping to tip a ball that was going out of bounds toward a teammate to avoid a turnover.
The requirements for players leaving and reentering the field of play are different for basketball than in some other sports. For example, in football, a receiver who leaves the field without being forced out becomes an ineligible. Any pass he catches will be waived off.