i found a cheap u$d 850 build, it uses MSI B650 Gaming Plus WiFi, but it uses pcie 4.0 slot, if i buy 9070xt (which uses 5.0 slot) will the graphics card work properly?
Generally, PCIe auto negotiates transfer speeds and lanes. Similar to a USB drive. It will probably work, but will be limited to the lowest common transfer speed.
I don't know what you are using the card for, but I don't think you will be able to saturate that pcie5 speeds. In gaming and everyday usage at least you won't be able to spot the difference.