I adopted a pregnant stray several months ago. It wasn't easy, but she has slowly transitioned to being comfortable staying indoors. She had ran off on her own a couple of times before I finally decided to clamp down on that behaviour (no major incidents, but she left her newborn kittens for longer than I was comfortable with). For awhile, she drove me crazy with her late-night whining, which would go on for several hours daily, so I started taking her out on walks. This was also a challenge in the beginning- she was actually fine with the harness, but she would want to go everywhere she couldn't (under cars, in bushes, up to people's front doors, back yards, underneath fences, etc...). There were times where I was certain I couldn't co-exist with her in my home, and seriously considered giving her up.
Slowly but surely, she calmed down, and while she's isn't quite a 100% indoor cat yet, Newt's come a loooooong way. Not just with her outdoor tendencies, but her overall disposition is also better (not that she was a trouble-maker before, she was actually a perfect cat aside from her manic "let me out of this house!" episodes).
I guess the point I'm trying to make is, it's perfectly possible for a cat to be accustomed to being indoors.