Is it ok to ask what the dresscode should be, or should I take the initiative and wear a suit anyway?
It's ok to ask anything.
Of course, asking this sort of question may feel awkward. And being awkward while asking a reasonable question doesn't always make a good first impression. You may want to ask someone other than the hiring manager, if you can find someone accessible. If you did a phone screen with a recruiter, for example, that would be one good source for asking a dress code question. A perfect source would be someone who already works at this company, or a friend of someone who already works at this company.
And if the company is local, you could swing by a day before the interview and check out the place from outside. As you see people walking in or out, you can get a sense of what they are wearing.
In the past, when I couldn't find a better way, I've called up the front desk and told them "I'm coming in for an interview tomorrow in the X department. Could you tell me what people typically wear there?" I didn't mention my name. If you ask people nicely, they will often be quite helpful.
If you still can't get a good sense of appropriate interview wear, then dress up and wear a suit. Overdressing is usually considered less harmful than under-dressing.
Good luck!