You can own a dog if you live on a military base - in family housing.
If you live in the barracks (dorms if you're in the Air Force), you cannot.
however, you might be able to live off base, in an apartment that allows pets.
If you get deployed, someone will have to take care of your dog for you.