In the modern world, building an autonomous multi-robot system is essential to coordinate and control robots to help humans because using several low-cost robots becomes more robust and efficient than using one expensive, powerful robot to execute tasks to achieve the overall goal of a mission. One research area, multi-robot task allocation (MRTA), becomes substantial in a multi-robot system. Assigning suitable tasks to suitable robots is crucial in coordination, which may directly influence the result of a mission. In the past few decades, although numerous researchers have addressed various algorithms or approaches to solve MRTA problems in different multi-robot systems, it is still difficult to overcome certain challenges, such as dynamic environments, changeable task information, miscellaneous robot abilities, the dynamic condition of a robot, or uncertainties from sensors or actuators. In this paper, we propose a novel approach to handle MRTA problems with Bayesian Networks (BNs) under these challenging circumstances. Our experiments exhibit that the proposed approach may effectively solve real problems in a search-and-rescue mission in centralized, decentralized, and distributed multi-robot systems with real, low-cost robots in dynamic environments. In the future, we will demonstrate that our approach is trainable and can be utilized in a large-scale, complicated environment. Researchers might be able to apply our approach to other applications to explore its extensibility.