I would say it is generally up to the instructor. If the class involves things like "labs" being done, where you use up materials or there is some sort of preparation needed, your likelihood of approval may be reduced. However, for just sitting through lectures, I wouldn't mind (as a college instructor).
When I was an instructor, my job was to share knowledge, and help students to become skilled. If some previous student wanted exposure to my lectures again, I would have no objection as long as it isn't causing any problem, such as depriving any of my currently-enrolled students (who currently have higher priority to my resources) by imposing a reduction in their experience. The more common alternative is that a previous student would rather spend time playing video games than re-visiting a class when such visits are not required. If a student chooses to invest in improving their skill, that is only likely to be a good thing (for me, for the university, for the student, for the students' employers).
One thing I would be cautious about doing is to be very wary about asking questions mid-class if you are out-of-the-loop and not a formal student. However, I remember visiting my mother during a Pre-calculus class, and noticing an error made by the instructor. I raised my hand (as a non-student) and asked a question which helped the instructor to recognize the error, and the instructor thanked me. It was an entirely positive experience, but it was a bit of a gamble because some instructors would not like that.
I would probably try to not interact with the instructor, unless the instructor initiates the interaction (by calling my name, specifically). For instance, I would not try to to help the instructor move the class along, by having me ask a bunch of questions when I have an idea of how the instructor will respond. As a visitor, I have a different role, which is often to be rather invisible.
Whether the instructor questions, to himself/herself, about the grade given, is not likely a concern of yours, if the instructor only teaches beginner-level classes and you're unlikely to have the instructor again. Changing a grade may be a significant bureaucratic headache, even if it is just a few days later (and maybe even if it is done before the grades are due, once the instructor submitted the first time). An instructor is unlikely to change a grade over a minor reason, like changing an opinion of how much you deserved. (Although, if there is a clear actionable reason, such as responding to fraud, the instructors may be more inclined, perhaps in part because there may be a clear policy that is less painful to the instructor.) So long as you were honest, you probably don't need to worry about your prior grade.
The reason why Fábio Dias's instructor laughed was probably the admission of not remembering stuff. There might be classier ways of saying "I'm interested in being exposed to the material again", especially something like being a TA. Of course, a lot of the precise details will vary between different instructors, and differences in institution (university) policies/cultures might also have some influence.