In this work, we adapt the epidemiological SIR model to study the evolution of the dissemination of COVID-19 in Germany and Brazil (nationally, in the State of Paraiba, and in the City of Campina Grande). We prove the well posedness and the continuous dependence of the model dynamics on its parameters. We also propose a simple probabilistic method for the evolution of the active cases that is instrumental for the automatic estimation of parameters of the epidemiological model. We obtained statistical estimates of the active cases based the probabilistic method and on the confirmed cases data. From this estimated time series we obtained a time-dependent contagion rate, which reflects a lower or higher adherence to social distancing by the involved populations. By also analysing the data on daily deaths, we obtained the daily lethality and recovery rates. We then integrate the equations of motion of the model using these time-dependent parameters. We validate our epidemiological model by fitting the official data of confirmed, recovered, death, and active cases due to the pandemic with the theoretical predictions. We obtained very good fits of the data with this method. The automated procedure developed here could be used for basically any population with a minimum of extra work. Finally, we also propose and validate a forecasting method based on Markov chains for the evolution of the epidemiological data for up to two weeks.