"Allowed" is an interesting term in the context - there is no almighty Council of Historians dispensing judgement as to what history is and isn't permitted (except, perhaps, for the AskHistorians mod team). There aren't - and can't be - hard and fast rules about how much historians can infer and speculate from their sources. Ultimately, the only real burden is to be convincing in your interpretations. This might be formal, such as through an academic peer review process (ie do experts in the field think your argument holds water) or informal (ie does any given person reading your work think it's rubbish). Either way, this judgement is always going to be somewhat subjective, and reliant on the knowledge and skills of the reader. That's a key advantage of dealing with peer-reviewed history: you can be relatively confident that the writer isn't 'cheating' by leaving out evidence that might contradict their interpretation and make their speculation appear more convincing than it actually is.
The reason there can't be any particular rule against speculation is that there is no period or point in human history where we have a full picture of what actually happened. Sometimes time, and the nature of the qustions we're asking might mean that few sources, if any, have survived. In some cases, we might know an awful lot, from multiple surviving perspectives, but we're never going to be able to know everything because we can't get inside the heads of historical actors. To construct a coherent narrative, therefore, historians always need to speculate to some extent. The key is speculating convincingly, by reconciling what you claim with what is known, and being clear about the limitations of certainty for what you're speculating about. Does your version of events explain the direct evidence that is available? Are you allowing for and acknowledging alternative explanations? Is there direct or contextual evidence that might contradict your interpretation? How much does your overall argument rely on this speculation? When you can't answer those kind of questions adequately, that's a sign that your speculation is going too far.