I want to give an unequivocal "No" as the answer, but that's too simple. General Swiss pairing rules (for where you want to find a winner from lots of players / teams and few rounds / matches) require you to not pair like that but there can be exceptions.
Let's start by looking at FIDE's Basic rules for Swiss Systems. It's mostly about the principles for a way to do fair pairings. The closest it comes to matching players with similar ratings is:
e In general, players are paired to others with the same score.
So, if players with similar ratings play at about the same level then after a few rounds they are likely to end up on similar scores and end up paired against each other but in general that doesn't happen most of the time kind of by design as we see next.
FIDE's General handling rules for Swiss Tournaments goes into more detail and makes it clear how pairing similar rated players is avoided:
2 Before the first round the players are ranked in order of, respectively
Strength (rating)
FIDE-title (GM-IM- WGM-FM-WIM-CM-WFM-WCM-no title)
alphabetically (unless it has been previously stated that this criterion has been replaced by another one)
3 This ranking is used to determine the pairing numbers; the highest one gets #1 etc.
This is key. When the pairing is done the first step is to split the players into score groups (you play against someone with the same or similar score) then each score group is split in two according to number of blacks and whites to try and ensure fair numbers for the players. Then in each score group and colour the groups are split in two according to their initial ranking and the high white group is paired against the low black group and vice versa. This pretty much guarantees mismatches in the early rounds in big fields.
This is done to ensure fairness in general, to give the best chance of fairly finding the best players according to how they play and to try and make the key pairings (between the players playing best) happen in the later rounds when they have a clearer idea of what they are playing for.
However there is one case in which these rules can be bent towards pairing players of more similar ratings against each other.
Acceleration
If a Swiss tournament has enough strong (IMs, GMs, WGMs, WIMs, FMs, WFMs etc) players from enough different federations then players who do well enough can achieve a title norm (IM, GM, WGM, WIM, etc.) If such a player has to play a weak player in round 1 and maybe also in round 2 then this lowers their average performance rating over the tournament and can decrease the chances of achieving a norm if there are too many weak players.
The solution to this is to use accelerated pairings. The details are spelled out in FIDE's FIDE-approved Accelerated Systems.
The basic method is to split the initial ranking of the players into two groups, the top half rated players and bottom half rated players, and to give all the players in the top group one or two "fictitious" points for the first two or three rounds, pair as normal and then remove the fictitious points after the two or three rounds of "acceleration".
This means that the two groups will end up playing within their group against more similarly rated opponents. Within the two groups they are still ranked and paired according to rating (after score) so this reduces the rating disparity but doesn't eliminate it.