An "out of control'' teenager has indicated he is likely to plead guilty to attacking a veteran police dog.

Salem, a 10-year-old German shepherd, was in pursuit of four men suspected of daubing graffiti on trains when he was allegedly kicked and hit with a baseball bat at Williamstown rail yards, in Melbourne's west, this morning.

One of the men, Zar Hunt, 18, later graffitied his police cell with a rock as he waited to be interviewed by investigators, the Melbourne Magistrates Court heard.

Hunt was released on bail this afternoon after his lawyer indicated he intended to plead guilty to the attack on Salem, who police say has served the force with distinction for eight years.