I think there should be no problem as long as the question can be framed so that it is in the scope of your subject (even if the project that "produced" the question is not directly related).
This should ideally be done by the student, while asking the question, but if there is an obvious part of the question related to your subject, it would be okay to gently push your answer in that direction.
You said you do a writing class, so for me, these would be good examples of viable questions (independent of the concrete project related to those questions):
Questions about writing tools (like LaTeX). If the student wants to know pros and cons of learning a new tool in context of a specific project, that is a valid question (as long as it was not explicitly covered in class). Even if it was covered during the lessons, a discussion based on a concrete example can be very useful.
Questions about best presentation of data: given a great amount of raw data, what would be the best way to present it? (graph, table, raw format, just description) If the student comes with the concrete data, he probably has either some ideas or some doubts about what representation to use.
Tools for analyzing or representing data. Again, no matter where the data came from, if there are some commonly used analysis tools (in the wide area), or representation tools, the question is related to the writing up the idea / project results, more than the project itself.
Questions about general structure of the piece of writing. Sometimes the content of the work makes the most common practice not applicable, or some other structure simply better.
For example, one of my articles has the Related work as a second-to-last section, because it simply didn't fit in naturally at it's "usual" second paragraph place. The discussion with my supervisors help clarify that and why it was okay.
Basically, any questions where you are the best suited to answer, independent of where the question comes from, is not misplaced. Those kinds of questions show that the students are applying and synthesizing their knowledge, and looking at it from a different (not-required) perspective, which is a good thing. (If I ever was in that kind of situation,) those questions would make me proud of my teaching since it meant the students are applying what I taught them "outside the box" I gave them.
Of course, if it is not that kind of question, there is nothing wrong in turning the student away, perhaps pointing him to the right person to talk to. Simply saying that there are people who are better suited to answer their questions, while making it clear that you would be more than happy to help within your area of expertise, should be enough.
Students that you are directly responsible for (i.e. your supervisees) might be a different story, but that might be out of the scope of this question :)