The Muslims do not have swine but they do have cats and dogs. Something to do with not touching haram animals. I know that Jews also consider pigs unclean, as well as cats and dogs. Is this uncleanness only about eating them or does it apply to owning them as well? Can they keep cats, dogs, swine?
One may not raise pigs anywhere. (Shulchan Aruch CM 409:2)
One may not raise vicious dogs unless they are always enchained. If one lives in a border town (where he fears the nearby enemy) he may release the dogs at nights. (:3)
Animals do not impart or contract ritual impurity while alive (at least not in any situation remotely likely for a pet owner (or anyone) to encounter). (Leviticus 11; Rambam Tum'at Meit 1:13-14, Tum'at Ochlin 2:6)
Very generally and speaking just from personal experience (so this isn't a halachic source), pet ownership even in Orthodox families is very widespread. This includes dogs (domestic, not wolves obviously), cats (domestic, not dangerous cats), parrots, rabbits, mice, and hamsters. None of these are Kosher. Even our Orthodox Rabbi owned parakeets (not Kosher). So right off the bat, I can tell you that the conventional understanding is that being not kosher does not preclude owning the animal as a pet. There may be exceptions, but this is the general practice.
A relevant Gemara at Bava Kama 80a/b goes into the permissibility of owning animals (there is some back and forth permitting and forbidding, and there is an implication that it's dependent on whether they're useful for keeping pests away) as well as some back-and-forth discussion about whether one may own a cat (seemingly depending on if it's the type that may injure children). I however am not in a position to make a judgement about what the Gemara's final conclusion and implications are.
This article by Rabbi Yehuda Shurpin (he brings original sources there) explicitly says that one may own non-Kosher animals as pets (he mentions a horse), but one may not make a business out of owning non-Kosher animals if they are normally consumed for food. However, in the case of swine, one may not own them at all (there are various instances in Tanach and the Talmud where swine are singled out in unfavorable ways, see the article for details of the ruling and sources). Also Bava Kama 79b explicitly states one may not raise pigs anywhere.
(Mishnah): We may not raise small animals (i.e. that do not work) in (settled parts of) Eretz Yisrael, but we may raise them in Surya or wildernesses of Eretz Yisrael. We may not raise chickens in Yerushalayim lest they cause Tum'ah to Kodshim. Kohanim (who eat Terumah) may not raise chickens anywhere in Eretz Yisrael; One may not raise pigs anywhere. One may raise dogs only if they are tied on a leash. We may not set traps for doves within four Mil of a settled area.
Another exception is the case of an "evil dog." This article by Rabbi Howard Jachter goes into detail with sources defining what is an "evil dog" and the prohibitions and conditions surrounding owning one. In fact there are many varying opinions on whether one may own any dog at all, but it appears that the majority of modern poskim permit (outright or with reservation) owning dogs that don't bite or cause damage.
Shulchan Aruch and most authorities limit the talmudic prohibition to ownership of "evil dogs". The clear implication is that one may own a dog for any reason, provided it is not an evil dog.
As a side note, as explained with sources in this other answer, simply touching non-Kosher animals doesn't impart impurity. It has to be dead (and then there may be differences depending on the kind of animal, but that is another issue).
Jews may raise dogs and the Tanach allows them to raise swine, but not eat them or any by product. So yes, the Tanach never says that it is forbidden to raise swine as pets. So yes, Jews may touch swine but not use them to eat.
A source from Yeshiva.com, Ask the Rabbi and reply from Rabbi Ro'i Margalit
When we look at Leviticus 11:27 & 28 we see the following:
"27 And whatsoever goeth upon its paws, among all beasts that go on all fours, they are unclean unto you; whoso toucheth their carcass shall be unclean until the even. 28 And he that beareth the carcass of them shall wash his clothes, and be unclean until the even; they are unclean unto you."
Being that the animal has paws precludes us from eating it. But then we see that when it comes to touching these animals the verse clarifies that anyone that who touches their carcass will be unclean until the even (evening, dusk, end of the day). The use of the word 'carcass' deals with the body of the animal being dead.
Any commentary that moves beyond the simple, easy to understand text is creating a problem where none exists.
So, don't eat your dog. If your dog dies and you touch it you will be clean by the end of the day. If you pick it up and move it to bury or otherwise dispose of the animal, you must wash your clothing and you will be clean at the end of the day (the even).