The dialogue is correct. Without additional punctuation, your first rewritten sentence (A) is incorrect. In both cases, the second rewritten sentence (B) is incorrect because you should use the simple past tense instead of the past perfect tense. You could, however, change the subject of (A) to you and use the past perfect tense.
A
Last week it was the first time....
Last week is used as a noun and is the subject of the sentence. There's no reason to add "it." In a subsequent sentence, however, you might use "it" to refer to "last week" when the subject is implied rather than stated.
If you add a comma after last week, you're using the phrase as an adverb, not a noun, and it is not the subject of the sentence anymore. So "it" functions as the subject of the sentence:
Last week, it was the first time...
B
Let's assume that A simply has "it" removed:
Last week was the first time I had watched a movie in many years. (correct)
When was the last time you had gone to the movies before that? (incorrect)
had gone is the past perfect tense. It means something that happened before something else. So it is asking for the last time you went to the movies prior to the first time I had watched a movie. That's not really what you mean.
Just use the simple past tense:
When was the last time you watched a movie?
When was the last time you went to a movie?
In your example, (A) is about you and (B) is about me. That's part of the reason why the past perfect doesn't work. It can work if they are both about you. For example:
Last week was the first time you watched a movie in years? When was the last time you had watched a movie before that?