Yes, you can lock it, but I believe it is better to teach the child limits. Your child is now old enough to listen and understnad very short talks. So take her to the toilet and say: yucky. This is for pee pee only. only mom and dad use this when we go to the bathroom. Otherwise the lid is closed. dirty water, danger....or something like that. I also plopped the lid down so it made a sound and that scared them at that age. Then say; now, if you want to play with water, ask mommy. If it is a good time, I will help you get a bowl to play with outside on the deck while I am weeding (or have her watch you from a stool while you clean dishes, etc.)
So, explain what the danger is using words like danger, ouch, safety, etc. Use a clear, stern (not angry), serious voice. then change your tone to light and happy and show her a better way to play. Ex: We don't play with mom's cell phone. No. It is dangerous (whatever). Then, here is your toy phone. Look how special and fun it is. You can press this button and it plays music, etc.
I also prefer the clear outlet covers because they get used to seeing it. When the were little, they tried to put things in them but they were covered. Now, they don't even "see" te plugs if we are out at a hotel for example. They just assume they are covered and don't even think about it.
-Oh, wait until a little older like 18 months or two years, but have abig talk about chemicals too. My mom did this as they didn't have baby locks then. She used a mraker to mark everything with a sad face and X. then say, yucky, danger...this will make you sick. Blahhh...sort of be silly but have that very serious tone. think about training a dog, they pick up on your tone and vocal patterns. Repeat the same thing over and over when ever you get a chance. See, mom is using the bathroom. this is the only thing the toilet is for. It is off limits for you.