In short, no, they are not dangerous to your scallions. The mushrooms appear to be one of the parasol type, likely Leucopcoprinus bimbaumii (link below). Its a saphrophytic mushroom, meaning it lives off decaying matter in the soil in the pot, and is not uncommon in containers. It is toxic if you eat it, but won't make your scallions toxic or poisonous. The spores (produced from the gills beneath the cap) will be in the air already, and if you have other houseplants, you may find the mushrooms appearing in there eventually too. Spores in the air or not a health threat - on average, every breath we take, we breath in about 40 spores from various fungi that we don't know are there.
Take a plastic bag, put it over your hand, cover the mushroom and twist each one off - the plastic bag will reduce spore spread. It's not essential you do this, but if you don't like the look of them or are worried someone might inadvertently eat them, its worth doing, but they'll be back at some point - they're only the fruiting bodies of mycelium present in the soil in the container. When you've finished with your scallions, if you want to, ditch the soil that's in the container, clean it thoroughly and disinfect it. Then replace the soil with new - but it doesn't mean it won't happen again. If you use potting compost or earth from the garden, mycelium from any type of fungus may already be present and may go on to produce fruiting bodies (meaning toadstools/mushrooms). Choosing a sterilised potting compost will reduce the possibility for this type of growth, particularly a houseplant potting medium, but it depends on how much partially composted material is still present in the mix.