It's entirely up to YOU to either:
- Accept the position that is currently offered to you.
- Wait for the other potential offer in the hope that it comes to be.
There are risks associated with either choice that you need to consider.
My own philosophy is to "let your yes be yes and your no be no". That means if you accept the first offer you should let the 2nd company know you have accepted another offer and are no longer available. So regardless of where you are in that interview process, you end it.
If you really want the 2nd job, decline the first position and hope things work out as you want. But, of course, there are no guarantees. The 2nd company may turn you down and then you must keep looking.
You could also ask the first company for more time and it's my belief that honesty is the best here. Just tell them why and perhaps use that to get them to "sweeten" the offer. In this case you might say:
The only thing holding me back from accepting it right now is the
internship part of the offer. If you could bring me on as a regular
junior-level developer I could accept the offer now.
For one thing that may buy you some more time as they consider their position but it also may get you what you want now without having to wait on the 2nd company.
You might also use the fact that you have an offer to accelerate the process with the 2nd company. You could say to them:
I've received an offer and I need to let them know by such-and-such a date. My first preference would be the position we're discussing, so is there any way we can accelerate the process?"
Interviewing candidates is a lot of work for companies and losing a qualified candidate is not desirable.
I do feel, however, that accepting an offer only to later turn it down for anything other than an extreme situation is very unprofessional. Bad decisions like that have a habit of coming back to bite you later in your career. For example the people you "burned" end up being around you in a few years. Most industries are "small" enough that you often encounter the same people again and again.