In the United States, if a body is being transported across jurisdictions, the document which authorizes such transportation is a burial transit permit.
The agency in charge of issuing such a permit is the local Health Department. Here's an example of the guidance from the State of Massachusetts: Issues to Consider in Preparing for Disposition of Decedents:
It is legal to transport a body within the same town or city (from a Boston hospital to a home in Boston, for example) after receiving the death certificate but before obtaining a burial permit. However, a burial permit must be obtained before transporting a body across the town or city line. If death occurs in Massachusetts, but families wish to transport the body to another state for disposition, families should contact the health authorities for those states the body will pass through for specific requirements.
In some jurisdictions, in order to receive a burial transit permit, it may also be necessary to get a death certificate for the deceased in the jurisdiction where the person is buried. See this example from The Legal Genealogist: Death in the Wrong Place.
Look for finding aids such as the FHL's Register of New York City Death Records to find out what collections may be held in libraries or archives. Page 153 of this PDF gives a summary of the information found within, and the FHL film numbers for their historical record collection, Manhattan Bodies in Transit, 1859-1894, ten volumes of transit permits for the date indicated. The catalog entry for this item shows a Locality subject of United States, New York, New York (City) - Vital records. Another catalog search strategy is to look for Authors whose names contain "Heath Department" or "Department of Health". (For other links for NYC, see my answer to How can I figure out who died on a particular voyage of a ship?. Whenever I see a starting date in a record collection like this, I use it as a pointer to legislation which mandated that the records should be kept.
The website Museum of Family History has an article with examples of NYC burial transfer permits from 1945 and 2005. The NYC Cemetery Project has other examples, such as the 1890 permit shown in the April 4, 2016 post Jesuit Cemetery, Fordham University.
As of 2003, in New York State, the person receiving a body must also provide a receipt for the body to the funeral director or undertaker who delivers it. The linked page on the state's website gives instructions on how a copy of the Burial Transfer Permit can be used as a receipt if the necessary that isn't already on the permit is added to it.
One strategy to find out the rules at any given time is to start with the current rules (for an example, see § Section 205.21: Burial, cremation, holding and transportation of human remains; disposition permit. at NYC Rules, and to look at the modern statutes. If the current rule is a modification of an older one, there should be a note that says this replaces an older section. Searching for that older statute may have a similar reference, so you can walk backwards through the 'lineage' of the law.
When I'm searching for historical laws on the state level, I usually start at The Legal Genealogist and plug the name of the state into the search box to see if Russell has posted recently about looking things up in that state's statutes. Next I'll try a Google search for the name of the state plus "statutes" and "online".
The rules for each locality are likely to be different for every locality -- and for completeness' sake, it's best to search every locality that the body may have been transported through, since each locality may have required a permit.
Other posts of interest on The Legal Genealogist: