I need a recommendation letter on my teaching. I want to ask the instructor in last semester for which I was a TA, but I don't know how his impression for my teaching. So do I need to ask him for his opinion about my teaching before letting him write the recommendation letter?
Yes. Don't be shy because you think you are asking him to write you a better letter, because in fact you are asking him whether he feels he is capable of writing you a good letter. The contrary could mean not that he doesn't like you, but that he doesn't have enough of an opinion to write a letter that would not be damning with faint praise, and if he declines and is a tactful person he would give that as his reason no matter what.
I have both personal and anecdotal experience with this situation. Once, I asked Barry Mazur for a letter when applying for an NSF graduate fellowship, and we did talk, but our contact had been pretty minimal at that time (it still is, really) and he said exactly what I wrote above: that he could write a letter but it wouldn't say much specific, so if I had someone who knew me better then I would be better served to ask them.
As for the anecdote, I will just use (possibly incorrect) pronouns as identifiers. At a "seminar" for applying for jobs, this person described how he once agreed to write a letter for a student who was highly regarded by others, and only later realized that he couldn't actually recommend her well. Having agreed to write the letter he produced one which was adequate but no more, and the student didn't get as good a job as it was generally felt she deserved. The writer described his guilt at doing this, because it was not his obligation to agree to write a letter for someone he couldn't give the best recommendation they could get.
People usually do not feel comfortable to say no when they are been asked to write a recommendation letter as they do not like to imply that they have negative views about your work. However, most decent people would try to avoid writing you a letter if they feel they cannot write a good letter. So when you ask for a letter always try to leave as much room for a polite refusal as possible. Therefore, phrase your request as a question, something like: if you feel you know my work well enough, would you be able to write me a letter of recommendation? If the answer is not yes or if they express too much hesitation, you probably better off asking someone else.