A military advisor was a high ranking member of the military who was a personal assistant, adjutant, and occasionally, spokesperson for those of a higher rank.
In 2293, the military advisor to the Chancellor of the Klingon High Council was brigadier Kerla. As a spokesman for the Klingon Government, he announced that there had been an incident on the Klingon moon Praxis. He also was present in an advisory capacity at the dinner aboard the USS Enterprise-A before Chancellor Gorkon's assassination later that year. He later served under Gorkon's successor, Azetbur. (Star Trek VI: The Undiscovered Country)
Kyle Riker was a civilian who was responsible for working out the Fuurinkazan battle strategies at the Tokyo Base. After that accomplishment, he was asked to go to work for Starfleet as a tactical advisor. In 2353, he was served as a civilian strategist advising Starfleet during its conflict with the Tholians. By 2365, Riker was stationed at Starbase Montgomery as a civilian advisor, most specifically as a "strategic attache with specialized knowledge of the frontier regions," when he came aboard the USS Enterprise-D to brief his son, William T. Riker on the USS Aries mission. (TNG: "The Icarus Factor")
Dukat became the chief military advisor to the Detapa Council after the political change on Cardassia that occurred in 2371/2372. Dukat later lost his position after it was revealed he had fathered Tora Ziyal with his Bajoran mistress Tora Naprem during the Occupation of Bajor. (DS9: "The Way of the Warrior", "Indiscretion")
Later that year, after he captured a Bird-of-Prey from the Klingons, Dukat was offered his old position as chief military advisor. Dukat turned them down after the Council ordered him to not use the ship, as they hoped for a diplomatic solution to the conflict. Dukat refused the offer, preferring to launch his own private war against the Klingon Empire. (DS9: "Return to Grace")