‘Buck’ indicates the lowest form of a rank in the army, such as ‘buck private’. However, ‘buck’ can also be a derogatory term for a black man, and so for Crooks ‘stable buck’ probably carries this meaning too.
The word ‘nigger’ was certainly understood as a pejorative term in the period of the book. The characters display a deep prejudice against black people that was very common at the time. Although slavery had been abolished in the United States in 1865, there was still widespread legal segregation of black people, forcing them to live separately, sit separately on buses and drink from separate water fountains. We can see this in effect in the segregation of Crooks's sleeping quarters, away from the white workers.