Yes, a 5K is right about 3.1 miles, and you should be fine in covering that distance. You may end up needing to walk some of it and that's perfectly okay. I needed to take a couple of walk breaks in my first 5K ever last December, then I had to take some walk breaks in the first couple I did back in May when I returned to running after having a broken ankle.
You may find the
C25K program at coolrunning a good way to help you make the transition from walking over to running. I'd advise using the time-based version and that you should try to avoid thinking that you have to go a certain distance. It's okay to take your time and run slow to begin with, running is very different in the leg muscles that get used and I feel it is much better to be patient about this if at all possible.
Trust me, as a guy who managed to break a bone doing too much too soon, it's a very good idea to be patient and think long term. That doesn't mean you can't go out and enjoy a 5K race, I feel it's a great thing to do and it'll let you see there's a whole lot of people at various levels of fitness, most all of them will be urging you on in some way.