I've seen a lot of people dismiss this match-up without much to say about it, aside from just blurting "Kamui". I've thought about it but it doesn't make sense to me.
Yes, it is absolutely correct that Kamui allows Obito to avoid many, if not all of Pain's tangible attacks, but it can be said to be the same vice versa. Obito's Kamui works perfectly defensively, but he fails to have anything in his arsenal to do any remotely decent damage back to Pain (lets say the fight takes place on even ground where either side has no extra knowledge so as to skew the fight). My argument is NOT that Pain/Nagato necessarily beats Obito, my argument is that the fight would result in a long-winded, rough stalemate.
I have deduced all of Obito's abilities, and the way I see it:
1> Obito's fire style is negated by Deva path's Shinra Tensei/ absorbed by Preta path. The deva path would not be able to negate a strong wood style attack from Obito, but given that wood style is simply a combination of earth and water release, and still uses chakra obviously, the preta path would still be able to absorb such a thing.
2> If Obito attempts to suck a path into Kamui, he is forced to materialise, allowing Deva path to disrupt with Bansho Tenin/Shinra Tensei, flinging him across the battlefield.
3> In the case that Obito does successfully suck a path into Kamui, the path in the Kamui dimension can attack Obito from the other side as accomplished by Kakashi. It is confirmed that the paths can still connect to Nagato, given that Nagato could still control the Animal path despite being inside Jiraiya's toad barrier, since there was no cut-off of chakra. Furthermore, it is repeatedly stated that the Rinnegan's visual prowess transcends the current plain where the shinobi world resides, and is exhibited when Nagato can use Rinne Rebirth to bring souls back from the afterlife. Given that Nagato has control over certain facets in the afterlife, and assuming that the afterlife is further "out of reach" than the Kamui dimension (as a way to word it), it would not be unreasonable to believe that Nagato may possess the ability to control the paths in Obito's pocket dimension.
4> Obito's typical usage of Kamui is to surprise attack by appearing behind individuals with Kamui, catching them offguard. This may not be feasible, given the expansive field of vision Pain possesses through each path, as well as the Naraka path's King of Hell and all the Animal path summonings. This would make a surprise attack much more difficult for Obito to execute.
5> This is partially headcanon, but throughout the whole manga, there has been no instance where a Rinnegan wielder has been afflicted by visual genjutsu. Sound genjutsu was used by the frogs on Pain, which worked incredibly, but it can be argued that the Rinnegan can see through the Sharingan's visual genjutsus due to its superiority as a dojutsu.
6> Obito would not be able to see the chakra threads connecting the Pains to Nagato. The reason why Obito would not be able to see the chakra threads is that when Pain fought Kakashi, Kakashi's sharingan did not detect such a thing. Furthermore, Hinata's encounter with Pain, as well as the lone Hyuga watching the entire battle, did not notice any chakra threads from Pain, and the Byakugan is superior to the Sharingan in detecting chakra networks.
7> Obito's display of taijutsu with Kamui is why Obito is renowned as one of the strongest Naruto characters. However, in order to land any form of physical attack/suck them into Kamui, he would have to materialise. I already mentioned the Deva path's disruption of such a thing, but this disruption in conjunction with the human path would make Obito wary. If Obito materialises, he risks being one-shot by the human path's soul absorption.
8> Obito has no way of handling the ridiculous amount of summonings the Animal path has to offer, other than passing through them with Kamui. Again I reiterate, this shows that Kamui works perfectly defensively, yet fails to do anything back to Pain. This would mean that Pain's field of vision is greatly enhanced, and Obito has no way to handle some of the summonings physically ( the bird summoning is out of his reach in the sky, and he has no destructive jutsu capable of annihilating the panda summoning and others.)