https://www.slab.org.uk/faqs/i-live-abroad-can-i-apply-for-scottish-legal-aid/
You can apply for advice and assistance and civil legal aid for any case involving a matter of Scots law.
You can apply for legal aid in Scotland as long as the courts in Scotland can deal with your case.