It helps to gain the trust of a feral cat by initially providing food and taking time for them to become accustomed to you being around. However, bringing a feral cat inside might be necessary after trapping for safety.
In those cases, a cat might be forced inside against their will, but providing a safe hiding space and taking the time for them to get used to you on their terms can make a world of difference in transitioning to an indoor-only lifestyle.