If the student did the work, then I see no problem at all. While its never happened for me with an undergrad dissertation (mostly because UGs get about 3 weeks to write their dissertation after the research period has finished, and a paper takes at least 6 months to go through review), this is a pretty normal thing to happen for a PhD.
Write up the paper first and submit it for publication. Use this as a good starting point for the thesis. If the stars align, the paper will be back from review with corrections at about the time the thesis is submitted, and the corrections to the paper can be done while the student is waiting for their viva.
This is all on the proviso of course that the student actually writes the dissertation themselves and doesn't just paraphrase an article written by their supervisor.