Depends, our nuclear deterrent isn't there to act on behalf of other non-NATO countries, it's there for our own defence - regardless of how horrid and unfair it is to imagine Ukraine being nuked. The use of nuclear weapons has to be an absolute complete and total last resort faced with the destruction of our way of life.
If Ukraine gets attacked with a nuclear weapon, and we fire one back - we end up creating the most gigantic path of escalation which ultimately would result in a full scale East - West exchange, from which there aren't any winners, that's ultimately where it goes and nobody wants that.