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:
Many writers consider it bad form to use apostrophe -s possessives with pieces of furniture and buildings or inanimate objects in general. Instead of "the desk's edge" (according to many authorities), we should write "the edge of the desk" and instead of "the hotel's windows" we should write "the windows of the hotel." In fact, we would probably avoid the possessive altogether and use the noun as an attributive: "the hotel windows." This rule (if, in fact, it is one) is no longer universally endorsed.
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:
I think A is also acceptable.
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.
"Any" can be used with either a singular or a plural noun.
Any is a determiner. It generally suggests an indefinite amount or number, and is used when it is not important to say how much/ how many we are thinking of. Because of its "open," non-specific meaning, any is often used in questions and negative clauses and in other cases where there is an idea of doubt or negation (source)
It's the same in an "if" clause. It depends on who you are talking to, and what you want to say. For example, all of the following are valid:
(Addressing a group of multiple people, asking for a single idea) If you (plural) have any idea how to find Waldo, let me know.
(Addressing a group of multiple people, asking for a non-specific number of ideas) If you (plural) have any ideas on how to find Waldo, let me know.
(Single person, single idea) If you (singular) have any idea how to find Waldo, let me know.
(Single person, multiple ideas) If you (singular) have any ideas on how to find Waldo, let me know.
Note the difference in phrasing. If I want a single idea, I specify the idea (an idea how to ...). If I want multiple ideas, I instead have to specify the general topic (some ideas on how to ...
In your examples, you're asking the same question from a slightly different perspective:
If any student is interested ... (= "a particular type of student, of which there can be an unspecified number")
If any students are interested ... (= "some unspecified number of a particular type of student")
Both are fine, however there may be a slight difference in nuance as the singular might emphasize these individuals have some unique quality. For example, imagine a drill instructor talking to a group of new soldiers:
If any recruit is man enough -- or dumb enough -- to try and beat my time on the obstacle course, step forward now.
Depending on the intonation, this can be seen as a challenge to some especially brave recruit. The plural might instead be considered a challenge to the entire group:
If any of you recruits are man enough ...
Best Answer
As the definite article, "the" indicates an exact example of the noun it modifies.
In the first example, there is a specific dog that is the object. In the second, it could be any dog.
This one is a little more tricky, but the same rule applies.
First, the tables means that there are a specific set of tables being discussed.
In the first sentence, the legs means that he/she repaired:
In the second sentence, this is ambiguous. The carpenter definitely repaired some of the legs. Because it is plural, they repaired more than one leg. However, whether it was all of the (repairable) legs or not, we cannot say.
In this sentence, many operates as a determiner*. It describes good students. However, its meaning is ambiguous in the following areas:
That said, if you intend the third meaning you could say "The many good students will buy that book." But this has a different meaning:
In other words:
* A determiner or quantifier (link courtesy of choster) is a word that describes a noun or noun clause, telling us whether it is specific or general. The definite article ("the") is a determiner, as are indefinite articles and many other words that describe the specificity of the noun.