Mahrez, who scored 78 goals and made 59 assists for City in a trophy-laden spell at the club, made the switch to the Saudi Pro League on Friday. Sources told ESPN the deal was worth a total of £30 million ($38.7m).
Asked whether he had wanted Mahrez to remain at City, Guardiola told reporters: "Definitely. I enjoyed as a manager to be with him. I had a special relationship with him.
"Saudi Arabia has changed the market. A few months ago when Cristiano [Ronaldo] was the only one to go, no one thought this many top, top players would play in the Saudi league."
"In the future, there will be more, and that's why clubs need to be aware of what is happening. Riyad got an incredible offer, and that's why we could not say, 'Don't do it.'"
The Saudi Pro League has become an attractive destination for Europe-based players since Ronaldo joined Al Nassr in January, with Ballon d'Or winner Karim Benzema, World Cup winner N'Golo Kante and ex-Liverpool captain Jordan Henderson also making the move.
"They want to create a strong league, and so far they are the league who can do it," Guardiola added.
"Right now, the Saudi league, I don't know how long they will sustain it, but the feeling is that they will stay. The players want to take this experience to play in that league, and they are able to do it."
City's first match of the 2023-24 domestic campaign after their preseason tour is the Community Shield game against Arsenal on Aug. 6.