What if there is some kind of flaw in bitcoin and some people out there are generating bitcoins out of nothing, how would we know?
Since bitcoins don't actually exist, this isn't something we need to be concerned about. At the technical level, all that exists are inputs and outputs. A transaction is created by listing previously unspent outputs as inputs, and then creating new outputs. There is a requirement for transaction validity that (with the exception of the bitcoin generating transaction) the sum of the values of the outputs must be less than or equal to the sum of the values inputs. So, the question you are probably asking is: "What if there is some kind of flaw in bitcoin and some people out there found a way to create transaction outputs such that the sum of the values of the outputs exceeds the sum of the values of the inputs. Nobody has every seen a non-generating transaction that broke that rule. The source code has been very carefully reviewed by many people to make sure that validation is handled properly.
There are multiple implementations of the rules in multiple programming languages. To find such a flaw, you would need to find a flaw that nobody else had noticed, and which would work in every implementation in every programming language on every operating system. For such a simple rule: "Add up the values of the inputs. Add up the values of the outputs. Make sure that the first sum is greater than or equal to the second sum", it isn't very likely that a flaw could be hiding that would effect every possible implementation.
Is there some place or core command that really counts all the balances from all addresses in the blockchain?
There are people that have written software to add up the UTXO at various times. Due to permanent destruction of bitcoins and unspendable outputs, the total has always turned out to be less than what the theoretical calculated total should be.