"Companion" is the more natural of the two phrases to use.
"Company" has two relevant definitions in this case.
I enjoy the company of my dog. (definition 1a - the companionship of your dog)
My dog is my only company. (definition 1b - your dog as one of your companions)
The second is closer to your example, but the only is an important qualifier because it helps to highlight that you're talking about the dog being one of many potential companions. Just saying "my dog is my company" by itself sounds awkward.