On the Scottish side, it's important to remember the 2014 referendum on Scottish independence from the UK - just 2 years before the Brexit referendum.
As part of the campaign, Scots were promised that the only way to remain in the EU was to vote NO to independence; that an independent Scotland would automatically be ejected from the EU, and have to re-apply for entry with the unanimous approval of (then) 28 members.
EU members including Germany seemed neutral to positive about our chances, and even Spanish Prime Minister Mariano Rajoy (despite internal politics with Catalonia) pointedly did not threaten a veto. (NOTE : indy-leaning source!) Now while I can find no explicit threat of a veto by the UK, their emphasis on the difficulties did beg the unspoken question, who else would do a thing like that?
At least partly as a result of this, Scotland voted against independence from the UK, before voting very strongly in 2016, in favour of remaining in the EU (about 62%/38% for Remain, or about six times the overall UK margin for Leave).
Well that didn't exactly work out as promised, and we are no longer in the EU, very much against Scottish wishes.
It's now clear that the best prospect for returning to the EU is via a renewed path to Independence, and a new referendum is the first step on that path, the grounds underlying the former referendum result having been completely undermined.
Meanwhile, Nicola has asked the EU to "keep the light on for us".
(As noted in a comment, it remains to be seen how smooth EU reentry will be in practice)
The highest voted answer is pretty good on Northern Ireland but it seems completely off the mark on Scotland without telling this side of the story. People's minds are very much in favour of the EU and the accepted answer appears unaware of this.
RonJohn makes the fair comment that this answer didn't actually answer the question about Northern Ireland. The Remain majority in NI was much smaller, which may partially explain why there is less outrage at the way Brexit has unfolded. In addition, the UK has made substantial (and expensive and awkward) accommodations to NI wishes, in part as required by the Good Friday Agreement.
Thus it seems reasonable for all parties in NI to (a) not rock the boat and re-open past political wounds, and (b) wait and see how well Brexit (including the open border to Eire, and any customs friction that may arise elsewhere) works out for NI in practice.