How important is being in a good institute for a theoretical physicist?
It depends.

A good student who is very self motivated can rise above. That means you would need to be doing a lot of work in addition to the work assigned in class. If you can do that, consistently for your entire degree, you can come out knowing as much as you would in a "tough" school. 

It's a two-fold challenge.

First, there is doing it and keeping it up without somebody to drive you.  If you are that sort of person then GREAT! More power to you, I wish you well. But you won't need my good wishes, you will be too busy creating your own good future.

Second, there is getting recognition for this extra work. Eventually you will want to do something after undergrad. Whether that's grad school or industry or whatever, you need an entrance that allows you to get some credit for the extra work. 

Sometimes, a possible solution to the second part is to publish something in a research journal. Lots of undergrads publish a research article. Of course, it's a small fraction of undergrads overall. But if you can publish something it will go a long way to helping you in whatever your plans are for after undergrad.

Sometimes it's extra-curricular projects. Are you technologically gifted? Build something keen. Are you software creative? Write an interesting and useful computer program. Are you the gifted writer? Write a web site that explains some interesting physics topic. Are you a good video presenter? Maybe something for the Khan academy.

https://www.khanacademy.org/

If you are fortunate in the "summer jobs" you get, that can be very helpful also. One of the undergrads I met at a "cow college" was doing some interesting work with a local research company. They were doing a thing with testing microwaves for therapy in sports medicine. He got to do some of the mundane measurement work. It looked good on his resume, it taught him a lot about microwaves, and it paid the bills.

Sometimes a nearby school will have enrichment opportunities. If you were at a small school in Southern Ontario, you could consider managing to get some time at McMaster University.  They have a pool type nuclear reactor. You could get training on that for a few months. That would look pretty good on your resume for certain jobs and grad schools. Many universities will have some kind of lab or facility that you can do some kind of exchange program.

From the other side of things, a gifted student in a "tough" school may not achieve maximum results. Tough schools can sometimes be very regimented and by-the-regulation-book. "My way or the highway" kind of thing. It does not always nurture the creativity of a young student who has just come from a high school where he was top-of-the-pops while hardly trying. And tough schools might not have a friendly environment. Students might be far more competitive minded, angling for scholarships and such. 

The right school for you is a difficult choice. And it's one that, once made, is difficult to unmake.