Any PCIe device should work in any PCIe slot.
If the motherboard uses
open-ended slots, you can even run an x16 card in an x1 slot - at reduced performance of course.
Often times motherboards are fitted with x16 slots but those may only be wired up for x4 or x8 electrically.
And you often have options in the BIOS for how the PCIe bandwidth is assigned.
A reverse image search shows that you appear to have an MSI Z170A-G43 PLUS, and the manual states that the PCIe slots are wired up for:
x1
x16
x1
x1
x4 / x1
As is typical for many motherboards, the x4 slot shares bandwidth with the x1 slots, so you can
either run a single device at x4 speed, disabling the three x1 slots,
or use up to four devices at x1 speed.
It doesn't apply to your board, but another common PCIe setup is to have the x16 slot be switchable between x16 and x8, which enables the use of a second x8 slot on the board for a dual GPU setup (in x16 mode, the x8 slot is disabled).