Of course.
That's not the only time he played a bad guy in an SF series, though. Once upon a time there was a really bad SF series called
The Starlost, about a space ark that had malfunctioned. It was comprised of many different separate biospheres, each cut off from the other, and the people had no idea they were on an ark. Three people from one of them (an Amish/Mennonite sort of community) stumbled on the truth. They became outcast from their own people and decided to try to find the captain and crew of the ark, because the ark was off course and headed not for the planet they were supposed to colonize, but for the star itself.
The Star Trek connection here is threefold: Walter Koenig guest-starred in a couple of episodes as an alien named Oro - wearing a tremendously hideous, bright gold lame jumpsuit.
John Colicos guest-starred in one of the episodes (I don't remember if I saw that one).
The other Star Trek connection is that Harlan Ellison created this show, but became so angry with the continual changes being made that he made them use his "Cordwainer Bird" pseudonym in the credits.