Both are correct in their own senses.
I am sincerely thankful to my/our class teacher.
And as for your question about the project being your own, the subject that we speak of in the sentence is not the project but the teacher, and as such your class teacher is the teacher of all her students, not just you.
If the subject were a project, like:
I am thankful to everyone who contributed towards my project.
Here, we would use my instead of our because it is solely your project, not that of the class or a group of students.
The definite article is not used in this expression.
When we assign an entity membership in a class we use the indefinite article, regardless of how ‘determinate’ the entity is, because it is not the only member of the class.
For instance, we ordinarily say “I own a ’57 Chevy”—that is, “The car I own belongs to the class ’57 Chevy”. You own only one car, it is entirely determinate, you introduce it into the conversation with the definite article; but it is just one of many ’57 Chevys. You would only say “I own the ’57 Chevy” if you and your hearers were looking at a group of cars and you were identifying your car as the only ’57 Chevy in the group.
Likewise, when you speak of a particular individual known to your hearer, you use a definite determiner in identifying or naming her—my wife—but the indefinite article in assigning her to a class: “My wife is a graduate student in mediaeval English lit.”
In the same way, when you say “What a car!”, you are not identifying the car but asserting its membership in the class of “cars to which attention should be drawn”.
We never say "What the X," because that utterance is not intended to identify which X you are talking about. It does not enjoin the hearer to "Look at that X", it observes that that X is an X of a certain class: it is an X which excites your admiration and deserves your hearer's attention.
Best Answer
At first glance, I think most native speakers would agree with you, and say that both A and D are pretty much interchangeable. However, books like yours generally have a reason for making a distinction like this.
In this case, I think I've found it. From the Capital Community College's web page on possessives, we find:
My guess is that your textbook is either somewhat dated, and was originally printed when this "rule" was more widely applied, or else the authors thought it would be worth making this distinction even if the rule is no longer universal.
That's likely why D is considered a better answer than A. I'm curious, though: Do the directions for this set of problems say to choose the "correct answer", or say to choose the "best answer"? Sometimes two answers can be correct, but one can still be justifiably preferred over the other.
Of course, in cases like this, textbooks would be much more helpful if the reasoning was listed in the answer key, instead of just telling readers that the answer is D without saying why.
Getting back to your question, you said:
and I lean toward agreeing with you. But I think your book is also correct in that D is probably the "best" option of the four that are available, even if many native speakers sometimes ignore the rule about possessives and furniture. And you are definitely right about your Option E; in fact, the website even suggests this might be the best way to write it: The carpenter repaired the table legs. But that wasn't an option in the question.