Yes, wild camping is legal throughout Scotland, including Whithorn, as long as you follow the Scottish Outdoor Access Code.