In Azure Devops and TFS, is it possible to create a build artifact and release definition in a different collection than the original code repository?
Since on-premise TFS and the newly renamed Azure DevOps Server 2019 still have the concept of collections, which is the highest level of separation of data you can have (separate physical databases), you'd need to treat a code repo in Collection 1 as an external repository rather than try to discover it as a known internal repository.

You can do this in the Build pipeline of a build in Collection 2 by selecting External Git (if your repo is Git, TFVC is not supported), then clicking Add Connection and entering the Git repository URL and login credentials like in the screenshot below.  Once connected, your pipeline, if it produces artifacts, will store them in Collection 2, which can be used for a Release pipeline.