Can I use two USB-C to HDMI/DVI cables to hook up to two monitors from my MacBook Pro (2017)?
Can I buy a USB-C to DVI cable and plug the USB-C side directly to the MacBook Pro USB-C port?

Yes.  This is exactly how you would do it.
I would avoid using HDMI on your first monitor and instead opt for a pure DisplayPort to DisplayPort connection (the Thunderbolt ports natively output a DP signal). But if you must, use an active adapter for best results.   As for the monitor that uses the DVI port, a simple converter should do, depending on the monitor.  Depending on the resolution that monitor is capable of, you may need a dual link DVI adapter.  In that case, it  must be active.

Connect Apple 30&quot; Cinema Display to new MacBook USB-C
What&#39;s wrong with HDMI?