I'm pretty sure the rice would burn if you did that.. Maybe you could fry the onions and boil the rice then mix them together, but I've never tried just rice and onions together so I'm not sure what that would taste like.
Good luck
then can i put it in a oven dish andb? i have boiled i cup of rice chopped up 1large onion added some oil and if i put it into a oven dish can i bake it?
Yes you could but it would be better if you sauted the onions first and then added it to the rice and baked it. but i think that a recipe for rice pilaf ill work best for you. you can substitute water if you dont have stock for this recipe and instead of letting it cook on the stove you can put in the oven at about 350 for about 15 or 20 min or until you tip it and see no liquid.
http://elise.com/recipes/archives/001825rice_pilaf.php
Just baking it would be pointless, and would dry out your rice. There is not need to cook something then cook it again just for the purpose of cooking it to death.