Yes for a normal desktop. No for spanning a game across both.
This is the question almost everybody asks after buying their first monitor, and the answer splits cleanly in two. Once you know which half you are in, the rest is detail.
For an extended desktop - game on one screen, Discord or a guide on the other - mismatched monitors are completely fine. Windows handles displays of different sizes, resolutions and refresh rates side by side as a matter of course. Each screen keeps its own resolution and its own refresh rate. This is what the overwhelming majority of people mean when they ask, and there is no reason to spend money matching panels for it.
For spanning one game across both screens, they need to match. That is a specific mode - NVIDIA Surround or AMD Eyefinity - which combines several physical displays into one logical display. A group like that wants the same resolution and refresh rate throughout, and an Eyefinity group falls back to the lowest common resolution across its displays. Put a 1440p panel next to a 1080p one and you are running both at 1080p, which wastes the better screen.
What actually goes wrong with mismatched screens
Nothing breaks, but four things are mildly annoying and it is better to know before than after.
Windows jump size when you drag them across. If the two screens run different resolutions or scaling settings, a window dragged from one to the other resizes as it crosses. You get used to it in about a day, but it is the most noticeable difference day to day.
The mouse snags at the edge. When two screens are different heights or resolutions, the pixel rows do not line up, so the cursor can catch on the boundary where one screen ends and the other has not started. Windows lets you drag the display positions to align them however you like, which mostly solves it.
The panels will not look the same. Different brands, ages and panel types have visibly different color and brightness. Side by side, white on one screen looks slightly blue or yellow next to the other. This bothers some people enormously and others not at all, and no amount of adjustment fully removes it.
Different heights are the real ergonomic issue. Two screens of different sizes on their own stands put their centers at different heights, so you are constantly re-aiming your eyes. This is the one worth actually fixing, and the fix is a monitor arm rather than a new monitor - see what to check before buying one.
Does a mismatched refresh rate slow the faster screen down?
The concern people arrive with is that pairing a 60Hz screen with a 144Hz one drags the fast one down to 60Hz. On a modern setup running an ordinary extended desktop, each display runs at its own refresh rate and the fast one stays fast. If you do see your main screen sitting at the wrong rate, that is a settings problem, not a law of physics - check the refresh rate for that specific display in the Windows display settings and in your graphics driver's control panel, since both keep their own setting per monitor.
The case where the slower panel genuinely does hold the other back is the spanning one again: inside a Surround or Eyefinity group the displays are being driven as a single unit, and the group is limited by its weakest member.