In the English language there are hundreds of slang words with nautical origins, like in this case, dogsbody.
During the Napoleonic wars, the Eglish crown provided a very poor diet for the sailors. It was something like a type of boiled pease pudding. The sailors called this grub "dogsbody", because it was thought that even rotten dog meat wouldn't taste so awfull. With the time, the name was transferred from the dish to the people who had to eat it, usually the lowest class of the crew, who were also given the worst jobs aboard the ship. With the years the word became comon in informal language, meaning someone who is given the dirtiest jobs to do.