Would it be unwise to ask about the prospects of a publication for an undergraduate research position?
It depends on the framing of the question.

Asking "Will I get a publication out of this?" would make me uncomfortable. I don't know you. I don't actually know your work. I don't know if you can write well. I've had promising undergraduate researchers who elected to spend the summer playing XBox and phoning it in. Or just getting tangled up in some sufficiently oddball idea that I can't get them out of in time for them to have done anything productive. I'm not going to promise those people there's a paper waiting for them at the end.

On the other hand, I actively encourage students to think about the potential for publication. Is that something they're interested in? Could this be turned into an undergraduate thesis project? etc.

Part of this is understanding where your project fits in the greater context of the lab's work - it might be a relatively small part of a larger project, at which point it's probably not going to get a paper all of its own. But there are also other avenues - for example, my current institution has undergraduate research showcases that include a poster competition.

So I wouldn't head straight for asking about publications in and of themselves, but rather consider framing it as how your research fits into labs work, what can be done with the output, etc.