Yes you can is the short answer.
You will however need to proof 90 day in-state residency as a legal permanent resident. I am not sure whether your immigrant visa will be sufficent to prove legal permanent resident status but as soon as you get your green card you're good to go for sure. Some dealers refuse doing business with non-US citizens but legally you can buy firearms. Most reputable dealers will not have any problems as long as you have the appropriate document and Alien Registration number. There will however almost certainly be hold (anywhere from 15 minutes to a few days) before they clear you. You are also able to buy NFA items.
You will however need to proof 90 day in-state residency as a legal permanent resident. I am not sure whether your immigrant visa will be sufficent to prove legal permanent resident status but as soon as you get your green card you're good to go for sure. Some dealers refuse doing business with non-US citizens but legally you can buy firearms. Most reputable dealers will not have any problems as long as you have the appropriate document and Alien Registration number. There will however almost certainly be hold (anywhere from 15 minutes to a few days) before they clear you. You are also able to buy NFA items.