Repairing a twisted front rim in emergency?
It is a professional's job to true and tension a wheel. One worth learning to do for yourself, but not one to jump into without knowledge and the proper tools. No it is not easy to do on the road, except as an emergency " get you home" fix. Very likely, a amateur attempt to fix it on the road will result in more damage. 

In addition, a "somewhat twisted" rim from riding without a tube for an extended period usually indicates a problem with the metal of the rim being physically bent. In order to true a wheel, you add tension to each spoke until the rim is straight and the wheel is round under high tension. But if the wheel doesn't start straight, the spokes will not be tensioned evenly, and the job will not last for more than a few hours, or days if you are lucky. It requires skill, and quality tools, or you will make the damage worse. I would suggest in the future, walking the bike om, rather than risking this kind of permanent damage.

If you have disc brakes, you may be able to run different sized wheels in the bike for an emergency, but it will change how the bike handles, and may affect the safety of riding the bike.

If your bike has brakes that grab the rim to stop, then you must use the original size rim to replace it, because otherwise you will have no brakes.