The government can have a tremendous impact on the allocation of resources in a country. This is especially true in countries where the government is more deeply involved in the economy, but it is true even in relatively laissez-faire countries such as the United States.
In countries such as China, the government is deeply involved in the allocation of resources. It helps to decide which industries will be promoted. It owns many of the major companies. Because of this, it can help to decide, for example, whether resources will be devoted to the production of consumer goods for the domestic market or for export.
But even countries like the US have governments that can affect the allocation of resources. For example, the US government subsidizes health care through Medicare and Medicaid and through the fact that it does not tax the value of health insurance that people get as part of the compensation for their jobs. This makes it relatively easier for health care providers to prosper. This means that more resources are allocated to health care than might be allocated if the government did not subsidize this industry.
In these ways and many others, governments can affect the allocation of resources in an economy.