A coastguard team rescued a stranded dog off the coast of Scotland on Sunday.