Examples from Russian literature courtesy of Yandex: Но меня даже не пустили во двор. - But they wouldn't let me into the yard. Он вошёл во двор. Налево потом. - He went into the courtyard, then turned left. I seems like it is used in both instances.
I also have seen courtyard used in English to refer to any outdoor area where the only access is through a building, not necessarily a space surrounded by buildings. I would say courtyard, yard, back yard are pretty much the same thing.