For communities or users many clients (including the default web ui) understand relative links, like [!asklemmy@lemmy.ml](/c/asklemmy@lemmy.ml)
or [@tymon@lemm.ee](/u/tymon@lemm.ee)
. The problem with these is that if instance the person reading your messages is on doesn't know that user/community (because no one is locally subscribed to it or there have been no actions seen by that user) you will get an ugly 404 page with the only remedy being to perform a search for that unknown user/community/whatever manually. I think this issue is being worked on to make things more seamless, but IDK when this experience will be improved.
There is also technically no guarantee that any instance will keep track of non-local objects perpetually, so the "canonical" location of a thing is generally on the server that the user is based on. Posts and comments are referenced by a sequential ID that is different on every instance, so... yeah.
Technically there is a unique ID for every object sent through ActivityPub, so those may be linkable in the future with a similar scheme such as /post/288327@lemm.ee
or something uglier like /post/https%3A%2F%2Flemm.ee%2Fpost%2F288327
depending on compatibility needs (as the IDs in ActivityPub are all full URLs to the source object)