I've commuted using a unicycle. It wasn't terribly long distances and was mostly flat*, but it worked.
What did my unicycle have that any bicycle somebody here might consider for commuting didn't?
So, yes, any bike will work.
* People have ridden centuries on unicycles and ridden them on one-track riding that I wouldn't ride a two-wheel bike on...