Welcome to ScamWarners.
Anyone can make a deposit into an account if you know the account information. Others can not, however, take money out of an account.
In this instance, it sounds like your account has been "flashed". Account flashing is similar to a fraudulent check being deposited into it. The money will show in your account temporarily, before the fraud is found out.
Notify your bank that you believe the deposit/transfer to be fraudulent and why. Do not try to withdraw any of the money.
This topic contains the following information on account flashing:
•Flashing – this can happen in one of two ways, but basically involves the scammer trying to convince the victim that money has arrived in the victim’s bank account to stay, when really it is only paying a passing visit. The first way is when the scammer tells the victim he is making a direct transfer into the account using cash or a cashier’s check or some other secure payment method. The victim will see the proceeds in a couple of days, but actually the scammer has paid in a fake check, and the bank will eventually realise and debit the account again, leaving the victim out of pocket if he has sent on the proceeds. Essentially, it is like the basic check scam but with the scammer depositing the check instead of the victim. The other method requires the scammer to have access to a hijacked merchant account for credit card usage. These are the kinds of accounts any store or shop has, which enable them to make credits and debits to a credit card account with the card owner’s permission, of course. If a scammer has one, he can make a credit into the victim’s bank account with the merchant account, tell the victim the money is there, and later, when he’s got the goods or cashback he was after, debit the account again.