Yes, any PC gamepad with analog sticks will work with iRacing.
First you'll need to plug the controller in to your PC via USB or USB dongle + wireless, install the drivers if need be, and you're good to go.
Then in iRacing you calibrate it as you would a wheel. Follow the onscreen instructions and move move the stick left and right when it asks you to calibrate steering... push down the triggers for gas and brake calibration, etc.
NOTE: iRacing does not use Steam's controller integration. If you are trying to use iRacing with a Playstation controller, you must setup DS4Windows using the instructions at https://ds4-windows.com/