We derive a novel Bayesian algorithm for multiuser detection in the uplink of a multiple-input multiple-output (MIMO) orthogonal frequency division multiplexing (OFDM) system employing stacked space-time block codes, such as the stacked Alamouti code with two transmit antennas, and a stacked quasi-orthogonal code with four transmit antennas. The proposed technique accomplishes joint estimation of the carrier frequency offset, phase noise, channel impulse response and data of each active user. Its derivation relies on the specific structure of the transmitted signal and on efficient Markov chain Monte Carlo (MCMC) methods. Simulation results evidence the robustness of the proposed algorithm in both uncoded and coded systems.