Is it legal to sell guns and ammo in a state that I am not a resident of?
It can depend on the state you are selling in and its regulations.
Is there a specific state you have in mind?
Partially depends on state, ammo is generally not a concern, but it depends what state you are in that will sometimes be a no.
Guns, almost always no unless going through an FFL. Federal law prohibits interstate transfers unless going through an FFL. So if you are in a state that is not your state of residence, or you are transferring to a person who resides in a state that is not your state of residence, you must use an FFL (and even then it might still be no, but that FFL will know)
Also, if it’s a handgun, the person receiving it must take possession via an FFL in their state.
No issue with ammo sales in Idaho.
But if you are not an Idaho resident, transferring a firearm to a person who is an Idaho resident will have to go through an FFL (transfer of a firearm to anyone who is not a resident of the same state as yourself requires an FFL)