Does the thesis statement have to come at the end of the introduction?
No, but by convention the reader will unconsciously expect to find the main claim of the paper somewhere near the end of the introduction. This placement makes sense from a genre or rhetorical perspective because the thesis statement will likely be more compelling or persuasive if you’ve already established some context for it in the opening parts of your introduction.